我发现在多个不同的崩溃报告中,出现了大量的崩溃实例,都以相同的致命异常结束:
[BluetoothDevice classicDevice]: unrecognized selector sent to instance 0x2805a8ba0
iOS 12 中也出现了几次,但在iOS 13中,这种情况变得更糟。还有其他人看到这个问题吗? 这是否与 iOS 13 中针对蓝牙的新隐私权限有关? 我已经没有其他线索可跟进,只是试图找到其他遇到此问题的人。
导致这个问题的堆栈跟踪并没有来自我的应用程序代码的内容,仅仅是AppDelegate的声明行。它全部由Foundation,CoreFoundation和苹果框架中称为BluetoothSettings的一些内容混合而成。并且我的崩溃日志缺少很多细节,可能是dsyms出了问题,但我不确定... 下面是崩溃日志。
Fatal Exception: NSInvalidArgumentException
-[BluetoothDevice classicDevice]: unrecognized selector sent to instance 0x2805a8ba0
0 CoreFoundation 0x191b8d54c (Missing)
1 libobjc.A.dylib 0x1918a80c8 (Missing)
2 CoreFoundation 0x191a8bb60 (Missing)
3 CoreFoundation 0x191b91bd4 (Missing)
4 CoreFoundation 0x191b93ac0 (Missing)
5 BluetoothSettings 0x1bb3ae944 (Missing)
6 Foundation 0x191f56a94 <redacted>
7 CoreFoundation 0x191ae5478 (Missing)
8 CoreFoundation 0x191ae54c8 (Missing)
9 CoreFoundation 0x191ae47c0 (Missing)
10 CoreFoundation 0x191ae446c (Missing)
11 CoreFoundation 0x191a5d434 (Missing)
12 CoreFoundation 0x191ae3d9c (Missing)
13 Foundation 0x191e457fc (Missing)
14 libobjc.A.dylib 0x1918a3af0 <redacted>
15 Foundation 0x191f81404 (Missing)
16 CoreFoundation 0x191b08b40 (Missing)
17 CoreFoundation 0x191b08a94 (Missing)
18 CoreFoundation 0x191b08200 (Missing)
19 CoreFoundation 0x191b030cc (Missing)
20 CoreFoundation 0x191b02978 (Missing)
21 GraphicsServices 0x19bc32534 (Missing)
22 UIKitCore 0x195bf4f0c (Missing)
23 MY APP 0x1003bf8e8 main + 42 (AppDelegate.swift:42)
24 libdyld.dylib 0x191982f04 <redacted>
showBluetoothAccessoryPickerWithNameFilter:completion
对话框并尝试配对操作系统从未见过的蓝牙设备来重现它。使用被遗忘的设备尝试并不会触发这个崩溃。对我来说,只有完全新的蓝牙设备才会引起问题。 - Aldryd