执行本机代码时收到 SIGABRT xamarin.ios
Got a SIGABRT while executing native code xamarin.ios
我构建了一个 xamarin.ios 应用程序。该应用程序一直运行良好。没有代码更改,而且出乎意料的是,应用程序现在在访问相机时崩溃了。我不知道为什么会这样,任何人都可以阐明这个问题吗?我已经 google 解决了这个错误并尝试了各种方法,包括删除各种包。我最近更新到 ios 10,但应用程序在更新后仍然运行良好。错误如下:
2016-10-10 21:44:28.925 Coacher[307:24128] critical: Native
stacktrace:
2016-10-10 21:44:28.934 Coacher[307:24128] critical: 0
libmonosgen-2.0.dylib 0x00363d33
mono_handle_native_sigsegv + 242 2016-10-10 21:44:28.934
Coacher[307:24128] critical: 1 libsystem_platform.dylib
0x1db5326d _sigtramp + 24 2016-10-10 21:44:28.935 Coacher[307:24128]
critical: 2 libsystem_kernel.dylib 0x1da9fd8f
+ 64 2016-10-10 21:44:28.935 Coacher[307:24128] critical:
3 libsystem_kernel.dylib 0x1da9fdd9
system_set_sfi_window + 0 2016-10-10 21:44:28.935 Coacher[307:24128]
critical: 4 TCC 0x201a8e85
+ 228 2016-10-10 21:44:28.936 Coacher[307:24128] critical:
5 TCC 0x201a8da1 + 0
2016-10-10 21:44:28.936 Coacher[307:24128] critical: 6 TCC
0x201ab57b + 276 2016-10-10 21:44:28.936 Coacher[307:24128]
critical: 7 libxpc.dylib 0x1db8915f
+ 46 2016-10-10 21:44:28.937 Coacher[307:24128] critical:
8 libxpc.dylib 0x1db89101 + 26
2016-10-10 21:44:28.937 Coacher[307:24128] critical: 9
libdispatch.dylib 0x1d9ae49b + 604
2016-10-10 21:44:28.937 Coacher[307:24128] critical: 10
libdispatch.dylib 0x1d9afa91 + 378
2016-10-10 21:44:28.938 Coacher[307:24128] critical: 11
libdispatch.dylib 0x1d9af8b7 + 106
2016-10-10 21:44:28.938 Coacher[307:24128] critical: 12
libsystem_pthread.dylib 0x1db55947 _pthread_wqthread +
1168 2016-10-10 21:44:28.938 Coacher[307:24128] critical: 13
libsystem_pthread.dylib 0x1db5549c start_wqthread + 8
2016-10-10 21:44:28.939 Coacher[307:24128] critical:
================================================================= Got a SIGABRT while executing native code. This usually indicates a fatal
error in the mono runtime or one of the native libraries used by your
application.
这是因为您的 iOS 10 更新。您现在需要请求相机的权限。下面的博客 post 解释了如何设置这些权限,现在。
https://devblogs.microsoft.com/xamarin/new-ios-10-privacy-permission-settings/
Starting in iOS 10, nearly all APIs that require requesting authorization and other APIs, such as opening the camera or photo gallery, require a new key value pair to describe their usage in the Info.plist. This is very similar to the requirement for NSLocationWhenInUseUsageDescription or NSLocationAlwaysUsageDescription to be put into the Info.plit when using Geolocation and iBeacon APIs. The difference now is that the application will crash when the app attempts authorization without these keys set.
我构建了一个 xamarin.ios 应用程序。该应用程序一直运行良好。没有代码更改,而且出乎意料的是,应用程序现在在访问相机时崩溃了。我不知道为什么会这样,任何人都可以阐明这个问题吗?我已经 google 解决了这个错误并尝试了各种方法,包括删除各种包。我最近更新到 ios 10,但应用程序在更新后仍然运行良好。错误如下:
2016-10-10 21:44:28.925 Coacher[307:24128] critical: Native stacktrace:
2016-10-10 21:44:28.934 Coacher[307:24128] critical: 0
libmonosgen-2.0.dylib 0x00363d33 mono_handle_native_sigsegv + 242 2016-10-10 21:44:28.934 Coacher[307:24128] critical: 1 libsystem_platform.dylib
0x1db5326d _sigtramp + 24 2016-10-10 21:44:28.935 Coacher[307:24128] critical: 2 libsystem_kernel.dylib 0x1da9fd8f + 64 2016-10-10 21:44:28.935 Coacher[307:24128] critical: 3 libsystem_kernel.dylib 0x1da9fdd9 system_set_sfi_window + 0 2016-10-10 21:44:28.935 Coacher[307:24128] critical: 4 TCC 0x201a8e85 + 228 2016-10-10 21:44:28.936 Coacher[307:24128] critical: 5 TCC 0x201a8da1 + 0 2016-10-10 21:44:28.936 Coacher[307:24128] critical: 6 TCC
0x201ab57b + 276 2016-10-10 21:44:28.936 Coacher[307:24128] critical: 7 libxpc.dylib 0x1db8915f + 46 2016-10-10 21:44:28.937 Coacher[307:24128] critical: 8 libxpc.dylib 0x1db89101 + 26 2016-10-10 21:44:28.937 Coacher[307:24128] critical: 9
libdispatch.dylib 0x1d9ae49b + 604 2016-10-10 21:44:28.937 Coacher[307:24128] critical: 10 libdispatch.dylib 0x1d9afa91 + 378 2016-10-10 21:44:28.938 Coacher[307:24128] critical: 11 libdispatch.dylib 0x1d9af8b7 + 106 2016-10-10 21:44:28.938 Coacher[307:24128] critical: 12 libsystem_pthread.dylib 0x1db55947 _pthread_wqthread + 1168 2016-10-10 21:44:28.938 Coacher[307:24128] critical: 13 libsystem_pthread.dylib 0x1db5549c start_wqthread + 8 2016-10-10 21:44:28.939 Coacher[307:24128] critical: ================================================================= Got a SIGABRT while executing native code. This usually indicates a fatal error in the mono runtime or one of the native libraries used by yourapplication.
这是因为您的 iOS 10 更新。您现在需要请求相机的权限。下面的博客 post 解释了如何设置这些权限,现在。
https://devblogs.microsoft.com/xamarin/new-ios-10-privacy-permission-settings/
Starting in iOS 10, nearly all APIs that require requesting authorization and other APIs, such as opening the camera or photo gallery, require a new key value pair to describe their usage in the Info.plist. This is very similar to the requirement for NSLocationWhenInUseUsageDescription or NSLocationAlwaysUsageDescription to be put into the Info.plit when using Geolocation and iBeacon APIs. The difference now is that the application will crash when the app attempts authorization without these keys set.