在使用plugin.media.crossmedia的xamarin表单ios中发生DirectoryNotFoundE


using (var file = await CrossMedia.Current.TakePhotoAsync(options))
{
.....
}

我正在使用跨媒体拍照xamarin表单ios(以上代码)。在app center

出现错误先。目录notfoundexception:无法找到路径的一部分"/var/mobile/Containers/Data/Application/D9CD5B7E-D0AD-41A1-97DA-9B6FC4471955/Documents/myapp/2266603_21-1-2021-12-0-21-4152. jpg

如何解决这个错误?

Error Message:
{
"length": 0,
"offset": 0,
"id": "4be55b3c-33f1-4bbf-99a3-b4af8203a0ba",
"exception": {
"type": "System.IO.DirectoryNotFoundException",
"message": "Could not find a part of the path "/var/mobile/Containers/Data/Application/D9CD5B7E-D0AD-41A1-97DA-9B6FC4471955/Documents/myapp/2266603_21-1-2021-12-1-19-8643..jpg".",
"stackTrace": "  at System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Int32 bufferSize, System.Boolean anonymous, System.IO.FileOptions options) <0x102720700 + 0x00214> in <0c3d4da7367647c9a650750b1a4d0c53#649cd0243319b7ca5a9179e97f48de1f>:0 n  at System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Int32 bufferSize, System.Boolean isAsync, System.Boolean anonymous) <0x102720650 + 0x0008f> in <0c3d4da7367647c9a650750b1a4d0c53#649cd0243319b7ca5a9179e97f48de1f>:0 n  at System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access) <0x102720420 + 0x0006f> in <0c3d4da7367647c9a650750b1a4d0c53#649cd0243319b7ca5a9179e97f48de1f>:0 ",
"wrapperSdkName": "appcenter.xamarin"
},
"properties": {
"message:": "Could not find a part of the path "/var/mobile/Containers/Data/Application/D9CD5B7E-D0AD-41A1-97DA-9B6FC4471955/Documents/myapp/2266603_21-1-2021-12-1-19-8643..jpg".",

},
"appId": "5993bbda-3072-45e5-9418-a260aa66a94f",
"installId": "761843BC-C04F-4E62-A3EB-C636C58CEFF7",
"isTestMessage": false,
"timestamp": "2021-02-03T03:44:15.833Z",
"sid": "5e3c4238-d2cc-42da-8ab4-319d4c97b21a",
"device": {
"sdkName": "appcenter.ios",
"sdkVersion": "4.0.0",
"wrapperSdkVersion": "4.0.0",
"wrapperSdkName": "appcenter.xamarin",
"model": "iPad7,5",
"oemName": "Apple",
"osName": "iOS",
"osVersion": "14.3",
"osBuild": "18C66",
"locale": "en_AE",
"timeZoneOffset": 240,
"screenSize": "2048x1536",
"appVersion": "3.1.1",
"appBuild": "3.9",
"appNamespace": "com.myapp",
"wrapperRuntimeVersion": "12.6.0"
}
}

假设您已经发布了所有相关代码,并且可以用它重现错误,那么异常就会在插件中发生。因此,您需要将这个问题提交给插件作者,以便他们能够解决它。

由于某种原因,您正在寻找这个文件myapp/2266603_21-1-2021-12-1-19-8643..jpg。注意到这里有两个"…"?

你应该修复你的代码,使它尝试引用myapp/2266603_21-1-2021-12-1-19-8643.jpg代替!

最新更新