我的应用中存在问题。我的应用正在使用互联网连接。当我在Xcode中运行它时,它运行时不会崩溃。但是,当我安装它时,它会运行,但是如果我关闭应用程序,然后在加载启动画面后再尝试再次运行它会崩溃。这是为什么?但是当我通过设备中的xcode运行应用程序时,这是有效的。
但是,当我使用3G而不是wifi时,它超越了启动画面
Incident Identifier: 5AAF8220-55D5-4011-B14A-F9A86C624F7C
CrashReporter Key: f0828a82293c0951598f3501da6c4cc391e66276
Hardware Model: iPad1,1
Process: mMusic [303]
Path: /var/mobile/Applications/6D985396-5C2A-430D-B605-617EFA46A470/mMusic.app/mMusic
Identifier: mMusic
Version: ??? (???)
Code Type: ARM (Native)
Parent Process: launchd [1]
Date/Time: 2013-09-25 10:11:07.842 +0530
OS Version: iPhone OS 5.1.1 (9B206)
Report Version: 104
Exception Type: 00000020
Exception Codes: 0x8badf00d
Highlighted Thread: 0
Application Specific Information:
com.microimage.mMusic failed to launch in time
Elapsed total CPU time (seconds): 1.050 (user 1.050, system 0.000), 5% CPU
Elapsed application CPU time (seconds): 0.237, 1% CPU
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0:
0 libsystem_kernel.dylib 0x357fb004 mach_msg_trap + 20
1 libsystem_kernel.dylib 0x357fb1fa mach_msg + 50
2 CoreFoundation 0x357693ec __CFRunLoopServiceMachPort + 120
3 CoreFoundation 0x35768124 __CFRunLoopRun + 876
4 CoreFoundation 0x356eb49e CFRunLoopRunSpecific + 294
5 CoreFoundation 0x356eb366 CFRunLoopRunInMode + 98
6 CFNetwork 0x314ade14 CFURLConnectionSendSynchronousRequest + 340
7 Foundation 0x34b304a6 +[NSURLConnection sendSynchronousRequest:returningResponse:error:] + 242
8 Foundation 0x34b54356 -[NSData(NSData) initWithContentsOfURL:] + 178
9 Foundation 0x34b85174 +[NSData(NSData) dataWithContentsOfURL:] + 36
10 mMusic 0x0013b2a4 0xa5000 + 615076
11 mMusic 0x0012fc34 0xa5000 + 568372
12 mMusic 0x000a6b96 0xa5000 + 7062
13 UIKit 0x32ecdca4 -[UIApplication _callInitializationDelegatesForURL:payload:suspended:] + 1176
14 UIKit 0x32ec77d6 -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 402
15 UIKit 0x32e95abc -[UIApplication handleEvent:withNewEvent:] + 1004
16 UIKit 0x32e95560 -[UIApplication sendEvent:] + 48
17 UIKit 0x32e94f34 _UIApplicationHandleEvent + 5820
18 GraphicsServices 0x33487224 PurpleEventCallback + 876
19 CoreFoundation 0x3576951c __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 32
20 CoreFoundation 0x357694be __CFRunLoopDoSource1 + 134
21 CoreFoundation 0x3576830c __CFRunLoopRun + 1364
22 CoreFoundation 0x356eb49e CFRunLoopRunSpecific + 294
23 CoreFoundation 0x356eb366 CFRunLoopRunInMode + 98
24 UIKit 0x32ec6864 -[UIApplication _run] + 544
25 UIKit 0x32ec3cce UIApplicationMain + 1074
26 mMusic 0x000a638c 0xa5000 + 5004
27 mMusic 0x000a62e8 0xa5000 + 4840
Thread 1 name: Dispatch queue: com.apple.libdispatch-manager
Thread 1:
0 libsystem_kernel.dylib 0x357fb3a8 kevent + 24
1 libdispatch.dylib 0x33b2eea4 _dispatch_mgr_invoke + 708
2 libdispatch.dylib 0x33b2ebc2 _dispatch_mgr_thread + 30
Thread 2 name: WebThread
Thread 2:
0 libsystem_kernel.dylib 0x357fb004 mach_msg_trap + 20
1 libsystem_kernel.dylib 0x357fb1fa mach_msg + 50
2 CoreFoundation 0x357693ec __CFRunLoopServiceMachPort + 120
3 CoreFoundation 0x35768124 __CFRunLoopRun + 876
4 CoreFoundation 0x356eb49e CFRunLoopRunSpecific + 294
5 CoreFoundation 0x356eb366 CFRunLoopRunInMode + 98
6 WebCore 0x37431c9c _ZL12RunWebThreadPv + 396
7 libsystem_c.dylib 0x349b472e _pthread_start + 314
8 libsystem_c.dylib 0x349b45e8 thread_start + 0
Thread 3 name: com.apple.NSURLConnectionLoader
Thread 3:
0 libsystem_kernel.dylib 0x357fb004 mach_msg_trap + 20
1 libsystem_kernel.dylib 0x357fb1fa mach_msg + 50
2 CoreFoundation 0x357693ec __CFRunLoopServiceMachPort + 120
3 CoreFoundation 0x35768124 __CFRunLoopRun + 876
4 CoreFoundation 0x356eb49e CFRunLoopRunSpecific + 294
5 CoreFoundation 0x356eb366 CFRunLoopRunInMode + 98
6 Foundation 0x34b30bb2 +[NSURLConnection(Loader) _resourceLoadLoop:] + 302
7 Foundation 0x34b30a7a -[NSThread main] + 66
8 Foundation 0x34bc458a __NSThread__main__ + 1042
9 libsystem_c.dylib 0x349b472e _pthread_start + 314
10 libsystem_c.dylib 0x349b45e8 thread_start + 0
Thread 4 name: com.apple.CFSocket.private
Thread 4:
0 libsystem_kernel.dylib 0x3580b570 __select + 20
1 CoreFoundation 0x3576d63a __CFSocketManager + 726
2 libsystem_c.dylib 0x349b472e _pthread_start + 314
3 libsystem_c.dylib 0x349b45e8 thread_start + 0
Unknown thread crashed with unknown flavor: 5, state_count: 1
答案 0 :(得分:15)
看起来你的应用程序被Springboard杀死了,因为它在监视程序计时器到期之前无法启动。
Exception Codes: 0x8badf00d
Application Specific Information:
com.microimage.mMusic failed to launch in time
看起来您正在进行同步调用以在应用程序启动时下载数据。这阻止了主线程导致应用程序无法及时启动。您应该首先允许应用程序完全启动,然后在后台线程(而不是主线程)上启动网络调用。
异常代码0x8badf00d表示应用程序已被iOS终止,因为发生了监视程序超时。应用程序花费太长时间来启动,终止或响应系统事件。其中一个常见原因是在主线程上进行同步网络连接。无论线程0上的操作是什么:需要移动到后台线程,或者以不同方式处理,以便它不会阻塞主线程。
希望有所帮助!
答案 1 :(得分:1)
如果您在崩溃日志中获得Exception Type: 00000020
和Exception Codes: 0x8badf00d
,那么这是由于在主线程上运行同步任务。解决方案是使用异步任务主线。
它被称为看门狗超时崩溃报告。您可以查看此Apple document for details.
答案 2 :(得分:0)
看到我们的watchos 3应用程序出现类似的崩溃。
部分问题是难以获得完整的崩溃报告。只有当我能够可靠地重现崩溃并重复20-30次时,我才能得到一个带有堆栈跟踪的连贯崩溃报告。看到许多部分报告包含一些json,包括kernel,crashReporterKey,memoryPages等,但只有一个包含堆栈跟踪的完整报告。
另一个问题是,xcode在调试时从未连接到设备。当然,应用程序因为花了很长时间才开始被杀,所以调试器没用。与模拟器相同的症状。
解决方案:我们在扩展委托的applicationDidFinishLaunching中激活了我们的wcsession。激活是异步的,所以我认为这没关系。将会话激活移动到applicationDidBecomeActive已经解决了这个问题。