如何调试UIDictationController中的崩溃问题?

3

最近我在尝试使用崩溃报告中提供的信息进行调试。到目前为止,我已经能够识别并修复一些错误,但还没有解决这个问题。

从崩溃报告中可以看出,UIDictationController 出了问题,但是我的代码根本没有调用 UIDictationController。该崩溃报告由 PLCrashReporter 生成。

似乎用户正在使用 iPad Mini (WiFi) 并运行 iOS 6.0.2。

Incident Identifier: [REMOVED]
CrashReporter Key:   [REMOVED]
Hardware Model:      iPad2,5
Process:         MyApp [2849]
Path:            [REMOVED]
Identifier:      com.yourcompany.MyApp
Version:         1.1
Code Type:       ARM
Parent Process:  launchd [1]

Date/Time:       2013-01-26 02:11:01 +0000
OS Version:      iPhone OS 6.0.2 (10A550)
Report Version:  104

Exception Type:  SIGABRT
Exception Codes: #0 at 0x32255350
Crashed Thread:  0

Application Specific Information:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSArrayM insertObject:atIndex:]: object cannot be nil'

Last Exception Backtrace:
0   CoreFoundation                      0x3882e2a3 __exceptionPreprocess + 163
1   libobjc.A.dylib                     0x30d8897f objc_exception_throw + 31
2   CoreFoundation                      0x387788d9 -[__NSArrayM insertObject:atIndex:] + 769
3   UIKit                               0x36ad24c3 -[UIDictationMeterView initWithFrame:] + 267
4   UIKit                               0x36abe699 -[UIDictationView initWithFrame:] + 281
5   UIKit                               0x36abdcd1 +[UIDictationView sharedInstance] + 145
6   UIKit                               0x36aae7f5 -[UIDictationController setState:] + 149
7   UIKit                               0x36aaef5f -[UIDictationController setupForDictationStart] + 199
8   UIKit                               0x36aae5d7 -[UIDictationController startConnectionForReason:] + 51
9   UIKit                               0x36aaf173 -[UIDictationController startDictationFromLayout] + 55
10  UIKit                               0x36825c09 -[UIKeyboardLayoutStar touchUp:] + 5249
11  UIKit                               0x3682472f -[UIKeyboardLayout touchesEnded:withEvent:] + 387
12  UIKit                               0x3670c5f1 -[UIWindow _sendTouchesForEvent:] + 525
13  UIKit                               0x366f9801 -[UIApplication sendEvent:] + 381
14  UIKit                               0x366f911b _UIApplicationHandleEvent + 6155
15  GraphicsServices                    0x3771e5a3 _PurpleEventCallback + 591
16  GraphicsServices                    0x3771e1d3 PurpleEventCallback + 35
17  CoreFoundation                      0x38803173 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 35
18  CoreFoundation                      0x38803117 __CFRunLoopDoSource1 + 139
19  CoreFoundation                      0x38801f99 __CFRunLoopRun + 1385
20  CoreFoundation                      0x38774ebd CFRunLoopRunSpecific + 357
21  CoreFoundation                      0x38774d49 CFRunLoopRunInMode + 105
22  GraphicsServices                    0x3771d2eb GSEventRunModal + 75
23  UIKit                               0x3674d2f9 UIApplicationMain + 1121
24  MyApp                               0x000032e1 main (main.m:36)
25  MyApp                               0x00003230 start + 40


Thread 0 Crashed:
0   libsystem_kernel.dylib              0x30f10350 __pthread_kill + 8
1   libsystem_c.dylib                   0x304f8973 abort + 95
2   MyApp                               0x000e954f uncaught_exception_handler + 27
3   CoreFoundation                      0x3882e57f __handleUncaughtException + 615
4   libobjc.A.dylib                     0x30d88a65 _objc_terminate() + 129
5   libc++abi.dylib                     0x3719807b safe_handler_caller(void (*)()) + 79
6   libc++abi.dylib                     0x37198114 std::terminate() + 20
7   libc++abi.dylib                     0x37199599 __cxa_current_exception_type + 1
8   libobjc.A.dylib                     0x30d889d1 objc_exception_rethrow + 13
9   CoreFoundation                      0x38774f21 CFRunLoopRunSpecific + 457
10  CoreFoundation                      0x38774d49 CFRunLoopRunInMode + 105
11  GraphicsServices                    0x3771d2eb GSEventRunModal + 75
12  UIKit                               0x3674d2f9 UIApplicationMain + 1121
13  MyApp                               0x000032e1 main (main.m:36)

有没有什么方法可以解决这个漏洞?或者至少减轻这个问题?提前感谢。

2个回答

1
问题在于你的应用程序中某个地方会弹出键盘,在iOS版本6.0.1和6.0.2中,即使你没有指定启用语音识别控制器,苹果也已经启用了它。修复它的两个解决方案:创建一个没有它的自定义键盘或在你的应用程序中实现语音识别。 我的建议是让它保持不变,只影响两个过时的iOS版本,并希望随着用户升级设备,崩溃问题将消失。

好的,谢谢提供信息。由于这只是苹果框架中的一个错误,而不是我的代码问题。我建议我的用户升级到最新的iOS版本,这样他们在按下语音输入键时就不会随机崩溃应用程序了。 - howanghk

0

我为自定义TextView设置了键盘,当用户按下语音输入按钮、说完话并完成后,尝试关闭键盘时会导致崩溃。可能你也遇到了这个问题?


我不知道,这是在生产环境中收集的匿名崩溃报告。到目前为止,我们还无法重现相同的崩溃。 - howanghk
我遇到了这个问题,有什么解决方案吗?我已经尝试并搜索了大约4-5个小时,但还没有成功... - Er. Khatri

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