查找 [BluetoothDevice classicDevice] 未识别选择器的崩溃源头

7

我发现在多个不同的崩溃报告中,出现了大量的崩溃实例,都以相同的致命异常结束:

[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>

我有完全相同的问题。 - Marc_V
@Marc_V 很高兴我不是一个人!你是否有比我更详细的崩溃日志?也许有显示CoreFoundation方法名称的内容? - prolfe
我在我的应用程序中也看到了这个问题。似乎是iOS 13的一个错误。由于我无法将其作为评论发布,我将在“答案”中发布完整的堆栈跟踪。除了“苹果错误”之外,有没有找到根本原因的好运? - Shackleford
我也收到了这些崩溃报告。你找到重现它的方法了吗?我无法让它发生。 - Zmaster
@Zmaster,我能够通过启动showBluetoothAccessoryPickerWithNameFilter:completion对话框并尝试配对操作系统从未见过的蓝牙设备来重现它。使用被遗忘的设备尝试并不会触发这个崩溃。对我来说,只有完全新的蓝牙设备才会引起问题。 - Aldryd
我今天在iOS 13上仍然遇到了这个问题,有人找到了解决方法吗? - jlucier
2个回答

4

我也在我的应用程序中遇到了这个问题。下面是带有符号的堆栈跟踪:

Fatal Exception: NSInvalidArgumentException
0  CoreFoundation                 0x18595dc30 __exceptionPreprocess
1  libobjc.A.dylib                0x1856780c8 objc_exception_throw
2  CoreFoundation                 0x18585bfc0 -[NSOrderedSet initWithSet:copyItems:]
3  CoreFoundation                 0x1859623d4 ___forwarding___
4  CoreFoundation                 0x185964570 _CF_forwarding_prep_0
5  BluetoothSettings              0x1af49f074 -[BTAlert showAlertWithResult:]
6  Foundation                     0x185d28288 __57-[NSNotificationCenter addObserver:selector:name:object:]_block_invoke_2
7  CoreFoundation                 0x1858b5b30 __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__
8  CoreFoundation                 0x1858b5b80 ___CFXRegistrationPost1_block_invoke
9  CoreFoundation                 0x1858b4e78 _CFXRegistrationPost1
10 CoreFoundation                 0x1858b4b10 ___CFXNotificationPost_block_invoke
11 CoreFoundation                 0x18582db08 -[_CFXNotificationRegistrar find:object:observer:enumerator:]
12 CoreFoundation                 0x1858b4440 _CFXNotificationPost
13 Foundation                     0x185c16dcc -[NSNotificationCenter postNotificationName:object:userInfo:]
14 libobjc.A.dylib                0x185673af0 -[NSObject performSelector:withObject:]
15 Foundation                     0x185d52c10 __NSThreadPerformPerform
16 CoreFoundation                 0x1858d9260 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__
17 CoreFoundation                 0x1858d91b4 __CFRunLoopDoSource0
18 CoreFoundation                 0x1858d8920 __CFRunLoopDoSources0
19 CoreFoundation                 0x1858d37ec __CFRunLoopRun
20 CoreFoundation                 0x1858d3098 CFRunLoopRunSpecific
21 GraphicsServices               0x18fa3d534 GSEventRunModal
22 UIKitCore                      0x1899f37ac UIApplicationMain
23 <redacted>                     0x104e0ded0 main + 25 (main.mm:25)
24 libdyld.dylib                  0x185752f30 start

截至目前,这个问题似乎只出现在iOS 13上(我收到了25份此崩溃报告,所有报告都是在iOS 13上发生的)。


我有同样的问题,而且崩溃日志也非常相似。只在iOS 13上出现。我认为我们可以安全地假定这与 Apple 有关。 - Alexis C.

2

我遇到了同样的问题。当调用系统弹出窗口并选择蓝牙设备时,我们能够重现这个崩溃。

    [[EAAccessoryManager sharedAccessoryManager] showBluetoothAccessoryPickerWithNameFilter:completion:]

目前我没有更多的信息,但这可能与IAP1支持有关。您的应用程序是否涉及蓝牙设备?


是的,我们正在使用IAP和蓝牙设备。 - prolfe
在我的情况下,我们正在处理iAP2设备。我还应该注意到,我已向苹果提交了一个错误报告,但尚未收到回复。 - Shackleford

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接