如何解决Xamarion.iOS CoreBluetooth BLE应用在iPhone 10上崩溃
要重现崩溃的步骤...
- Windows 10上的Visual Studio,与macbook pro配对
- 从github下载wojciech-kulik / Sample-Projects:https://github.com/wojciech-kulik/Sample-Projects
- 打开Sample-Projects-master \ Xamarin.iOS \ BluetoothTest \ bLUetoOTH tEST.SLN
- 与Mac配对
- 在iPhone 10上选择并调试 崩溃。 请参阅附件的崩溃输出。
已配置iPhone,并且可以运行其他Xamarin.iOS应用。
尝试重新启动所有设备。
崩溃输出................................. ............ 加载的程序集:/private/var/containers/Bundle/Application/6BD03353-EB72-4E79-8D3B-F72606BA7DE9/BluetoothTest2.app/System.Drawing.Common.dll [外部] 加载的程序集:/private/var/containers/Bundle/Application/6BD03353-EB72-4E79-8D3B-F72606BA7DE9/BluetoothTest2.app/System.dll [外部] 加载的程序集:/private/var/containers/Bundle/Application/6BD03353-EB72-4E79-8D3B-F72606BA7DE9/BluetoothTest2.app/Xamarin.iOS.dll [外部] 线程已开始:#2 加载的程序集:/private/var/containers/Bundle/Application/6BD03353-EB72-4E79-8D3B-F72606BA7DE9/BluetoothTest2.app/System.Core.dll [外部] 加载的程序集:/private/var/containers/Bundle/Application/6BD03353-EB72-4E79-8D3B-F72606BA7DE9/BluetoothTest2.app/BluetoothTest2.exe
================================================ ================== 本机崩溃报告
在执行本机代码时出现了错误。这通常表明 Mono运行时或本机库之一中的致命错误 由您的应用程序使用。
================================================ ================== 本机堆栈跟踪:
0x102ea23a8 - /private/var/containers/Bundle/Application/6BD03353-EB72-4E79-8D3B-F72606BA7DE9/BluetoothTest2.app/libmonosgen-2.0.dylib : mono_dump_native_crash_info
0x102e98620 - /private/var/containers/Bundle/Application/6BD03353-EB72-4E79-8D3B-F72606BA7DE9/BluetoothTest2.app/libmonosgen-2.0.dylib : mono_handle_native_crash
0x102ea18f4 - /private/var/containers/Bundle/Application/6BD03353-EB72-4E79-8D3B-F72606BA7DE9/BluetoothTest2.app/libmonosgen-2.0.dylib : sigabrt_signal_handler
0x19c9aa894 - /usr/lib/system/libsystem_platform.dylib : <redacted>
0x19ca99e58 - /usr/lib/system/libsystem_kernel.dylib : <redacted>
0x19ca99e88 - /usr/lib/The app has been terminated.
system / libsystem_kernel.dylib: 0x1a2f0dc64-/系统/库/PrivateFrameworks/TCC.framework/TCC: 0x1a2f0dba4-/系统/库/PrivateFrameworks/TCC.framework/TCC: 0x1a2f11ad8-/系统/库/PrivateFrameworks/TCC.framework/TCC: 0x19c874b1c-/usr/lib/system/libxpc.dylib: 0x19c8693e8-/usr/lib/system/libxpc.dylib: 0x19c9675a4-/usr/lib/system/libdispatch.dylib: 0x19c93e0f8-/usr/lib/system/libdispatch.dylib: 0x19c94e1c0-/usr/lib/system/libdispatch.dylib: 0x19c9b8bac-/usr/lib/system/libsystem_pthread.dylib:_pthread_wqthread 0x19c9bb740-/usr/lib/system/libsystem_pthread.dylib:start_wqthread
================================================ ================== 基本故障地址报告
本机指令指针(0x19ca957f4):0x19ca957e4周围的内存c0 03 5f d6 c0 03 5f d6 30 41 80 d2 01 10 00 d4 .. ... .0A ...
... 0x19ca957f4 e3 00 00 54 fd 7b bf a9 fd 03 00 91 b4 80 ff 97 ... T。{.......... 0x19ca95804 bf 03 00 91 fd 7b c1 a8 c0 03 5f d6 c0 03 5f d6 ..... {.... ... 。 0x19ca95814 d0 03 80 d2 01 10 00 d4 e3 00 00 54 fd 7b bf a9 .... .T。{..
该应用已终止。
解决方法
这是info.plist崩溃修复程序。 (但随后它会收到一个C#异常)
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleName</key>
<string>BluetoothTest</string>
<key>CFBundleIdentifier</key>
<string>pl.wojciechkulik.BluetoothTest</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>MinimumOSVersion</key>
<string>9.3</string>
<key>UIDeviceFamily</key>
<array>
<integer>1</integer>
</array>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>XSAppIconAssets</key>
<string>Assets.xcassets/AppIcon.appiconset</string>
<key>UIBackgroundModes</key>
<array>
<!--for connecting to devices (client)-->
<string>bluetooth-central</string>
<!--for server configurations if needed-->
<string>bluetooth-peripheral</string>
</array>
<!--Description of the Bluetooth request message (required on iOS 10,deprecated)-->
<key>NSBluetoothPeripheralUsageDescription</key>
<string>YOUR CUSTOM MESSAGE</string>
<!--Description of the Bluetooth request message (required on iOS 13)-->
<key>NSBluetoothAlwaysUsageDescription</key>
<string>YOUR CUSTOM MESSAGE</string></dict>
</plist>
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。