应用程序拒绝 - 崩溃报告说:未能及时创建场景 (badf00d) 出了啥问题?

Posted

技术标签:

【中文标题】应用程序拒绝 - 崩溃报告说:未能及时创建场景 (badf00d) 出了啥问题?【英文标题】:App rejection - Crash report says: failed to scene-create in time (badf00d) What is wrong?应用程序拒绝 - 崩溃报告说:未能及时创建场景 (badf00d) 出了什么问题? 【发布时间】:2015-01-05 19:30:34 【问题描述】:

我的应用刚刚被苹果拒绝,我可以通过一些帮助来找出问题所在。该应用程序在我所有的设备上都可以正常运行,并且不会崩溃。该应用程序在启动时立即与 iCloud 同步。这在我的设备上运行良好,但也许有问题。

这是第一个崩溃报告(符号):

Exception Type:  00000020
Exception Codes: 0x000000008badf00d
Highlighted Thread:  0

Application Specific Information:
com.Name.App failed to scene-create in time

Elapsed total CPU time (seconds): 9.250 (user 9.250, system 0.000), 23% CPU 
Elapsed application CPU time (seconds): 0.298, 1% CPU

Thread 0 name:  Dispatch queue: com.apple.main-thread
Thread 0:
0   libsystem_kernel.dylib          0x0000000192f7ceb8 semaphore_wait_trap + 8
1   libsystem_platform.dylib        0x00000001930299e0 _os_semaphore_wait + 20
2   libdispatch.dylib               0x0000000192e5e3e0 _dispatch_barrier_sync_f_slow + 516
3   Foundation                      0x0000000182aedccc -[NSUbiquitousKeyValueStore _synchronizeForced:notificationQueue:] + 248
4   Foundation                      0x0000000182aedb50 -[NSUbiquitousKeyValueStore synchronize] + 88
5   Cloud-Fryser                    0x00000001000dab08 0x1000d0000 + 43784
6   UIKit                           0x000000018645ce80 -[UIViewController loadViewIfRequired] + 688
7   UIKit                           0x0000000186512374 -[UINavigationController _layoutViewController:] + 60
8   UIKit                           0x0000000186512270 -[UINavigationController _updateScrollViewFromViewController:toViewController:] + 244
9   UIKit                           0x000000018651170c -[UINavigationController _startTransition:fromViewController:toViewController:] + 108
10  UIKit                           0x00000001865113b8 -[UINavigationController _startDeferredTransitionIfNeeded:] + 636
11  UIKit                           0x00000001865110d8 -[UINavigationController __viewWillLayoutSubviews] + 52
12  UIKit                           0x0000000186511058 -[UILayoutContainerView layoutSubviews] + 196
13  UIKit                           0x0000000186459a28 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 568
14  QuartzCore                      0x0000000185db1990 -[CALayer layoutSublayers] + 164
15  QuartzCore                      0x0000000185dac560 CA::Layer::layout_if_needed(CA::Transaction*) + 316
16  QuartzCore                      0x0000000185dac404 CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 28
17  QuartzCore                      0x0000000185dabc04 CA::Context::commit_transaction(CA::Transaction*) + 272
18  QuartzCore                      0x0000000185dab988 CA::Transaction::commit() + 432
19  UIKit                           0x00000001866e7014 -[UIApplication _reportMainSceneUpdateFinished:] + 56
20  UIKit                           0x00000001866e7ec0 -[UIApplication _runWithMainScene:transitionContext:completion:] + 2776
21  UIKit                           0x00000001866e6044 -[UIApplication workspaceDidEndTransaction:] + 180
22  FrontBoardServices              0x0000000189edd63c __31-[FBSSerialQueue performAsync:]_block_invoke + 24
23  CoreFoundation                  0x0000000181c66120 __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 16
24  CoreFoundation                  0x0000000181c65228 __CFRunLoopDoBlocks + 308
25  CoreFoundation                  0x0000000181c63428 __CFRunLoopRun + 692
26  CoreFoundation                  0x0000000181b911f0 CFRunLoopRunSpecific + 392
27  UIKit                           0x00000001864c7788 -[UIApplication _run] + 548
28  UIKit                           0x00000001864c2780 UIApplicationMain + 1484
29  Cloud-Fryser                    0x00000001000dc878 0x1000d0000 + 51320
30  libdyld.dylib                   0x0000000192e7ea04 start + 0

Thread 1 name:  Dispatch queue: com.apple.libdispatch-manager
Thread 1:
0   libsystem_kernel.dylib          0x0000000192f7cc94 kevent64 + 8
1   libdispatch.dylib               0x0000000192e6497c _dispatch_mgr_invoke + 272
2   libdispatch.dylib               0x0000000192e573b0 _dispatch_mgr_thread + 48

Thread 2 name:  Dispatch queue: com.apple.sydprotection
Thread 2:
0   libsystem_kernel.dylib          0x0000000192f96e50 __open + 8
1   libsystem_kernel.dylib          0x0000000192f95dbc open + 12
2   Foundation                      0x0000000182ab1ebc _NSReadBytesFromFileWithExtendedAttributes + 132
3   Foundation                      0x0000000182ab1ddc -[NSData(NSData) initWithContentsOfFile:] + 76
4   Foundation                      0x0000000182ad87fc -[NSData(NSData) initWithContentsOfURL:] + 384
5   Foundation                      0x0000000182ab1cf0 +[NSDictionary(NSDictionary) newWithContentsOf:immutable:] + 112
6   SyncedDefaults                  0x000000018dbab224 -[SYDRemotePreferencesSource _cachePlistFromDisk] + 104
7   SyncedDefaults                  0x000000018dbabedc -[SYDRemotePreferencesSource _synchronizeForced:] + 160
8   SyncedDefaults                  0x000000018dbabdac __48-[SYDRemotePreferencesSource synchronizeForced:]_block_invoke + 36
9   libdispatch.dylib               0x0000000192e55368 _dispatch_client_callout + 12
10  libdispatch.dylib               0x0000000192e5e6e4 _dispatch_barrier_sync_f_invoke + 72
11  SyncedDefaults                  0x000000018dbabd5c -[SYDRemotePreferencesSource synchronizeForced:] + 116
12  Foundation                      0x0000000182aecc74 -[NSUbiquitousKeyValueStore synchronizeWithSourceForced:] + 32
13  Foundation                      0x0000000182aecbe0 __46-[NSUbiquitousKeyValueStore _registerToDaemon]_block_invoke + 72
14  libdispatch.dylib               0x0000000192e553a8 _dispatch_call_block_and_release + 20
15  libdispatch.dylib               0x0000000192e55368 _dispatch_client_callout + 12
16  libdispatch.dylib               0x0000000192e5f4bc _dispatch_queue_drain + 1212
17  libdispatch.dylib               0x0000000192e58470 _dispatch_queue_invoke + 128
18  libdispatch.dylib               0x0000000192e61220 _dispatch_root_queue_drain + 660
19  libdispatch.dylib               0x0000000192e62758 _dispatch_worker_thread3 + 104
20  libsystem_pthread.dylib         0x00000001930312e0 _pthread_wqthread + 812
21  libsystem_pthread.dylib         0x0000000193030fa4 start_wqthread + 0

Thread 3:
0   libsystem_kernel.dylib          0x0000000192f97c78 __workq_kernreturn + 8
1   libsystem_pthread.dylib         0x0000000193031390 _pthread_wqthread + 988
2   libsystem_pthread.dylib         0x0000000193030fa4 start_wqthread + 0

Thread 4:
0   libsystem_kernel.dylib          0x0000000192f97c78 __workq_kernreturn + 8
1   libsystem_pthread.dylib         0x0000000193031390 _pthread_wqthread + 988
2   libsystem_pthread.dylib         0x0000000193030fa4 start_wqthread + 0

Thread 5:
0   libsystem_kernel.dylib          0x0000000192f7ce7c mach_msg_trap + 8
1   libsystem_kernel.dylib          0x0000000192f7ccf4 mach_msg + 68
2   CoreFoundation                  0x0000000181c655c8 __CFRunLoopServiceMachPort + 196
3   CoreFoundation                  0x0000000181c6351c __CFRunLoopRun + 936
4   CoreFoundation                  0x0000000181b911f0 CFRunLoopRunSpecific + 392
5   CoreFoundation                  0x0000000181be32a8 CFRunLoopRun + 108
6   CoreMotion                      0x000000018258a9d4 0x182548000 + 272852
7   libsystem_pthread.dylib         0x0000000193033e7c _pthread_body + 160
8   libsystem_pthread.dylib         0x0000000193033dd8 _pthread_start + 156
9   libsystem_pthread.dylib         0x0000000193030fac thread_start + 0

这是第二次崩溃报告:

Application Specific Information:
com.Name.App failed to scene-create in time

Elapsed total CPU time (seconds): 20.300 (user 20.300, system 0.000), 49% CPU 
Elapsed application CPU time (seconds): 0.207, 1% CPU

Thread 0 name:  Dispatch queue: com.apple.main-thread
Thread 0:
0   libsystem_kernel.dylib          0x0000000192f7ceb8 semaphore_wait_trap + 8
1   libdispatch.dylib               0x0000000192e62d98 _dispatch_group_wait_slow + 244
2   CloudDocs                       0x0000000188427818 -[BRXPCSyncProxy resultWithTimeout:] + 72
3   CloudDocs                       0x0000000188418bc0 __BRIsProcessForcingUbiquity_block_invoke + 172
4   libdispatch.dylib               0x0000000192e55368 _dispatch_client_callout + 12
5   libdispatch.dylib               0x0000000192e56240 dispatch_once_f + 92
6   CloudDocs                       0x0000000188418b0c BRIsProcessForcingUbiquity + 60
7   Foundation                      0x0000000182b3ad6c ___BRIsCloudDocsUsed_block_invoke + 44
8   libdispatch.dylib               0x0000000192e55368 _dispatch_client_callout + 12
9   libdispatch.dylib               0x0000000192e56240 dispatch_once_f + 92
10  Foundation                      0x0000000182b35044 ___NSFrameworkHandleForLibrarianSymbols_block_invoke + 96
11  libdispatch.dylib               0x0000000192e55368 _dispatch_client_callout + 12
12  libdispatch.dylib               0x0000000192e56240 dispatch_once_f + 92
13  Foundation                      0x0000000182b3acec ___initializeLibrarianFunctions_block_invoke + 268
14  libdispatch.dylib               0x0000000192e55368 _dispatch_client_callout + 12
15  libdispatch.dylib               0x0000000192e56240 dispatch_once_f + 92
16  Foundation                      0x0000000182b3a5b0 -[NSFileManager URLForUbiquityContainerIdentifier:] + 544
17  Cloud-Fryser                    0x000000010003dc04 -[AppDelegate application:didFinishLaunchingWithOptions:] (AppDelegate.m:20)
18  UIKit                           0x00000001864ce3cc -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 300
19  UIKit                           0x00000001866e522c -[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] + 2280
20  UIKit                           0x00000001866e79ac -[UIApplication _runWithMainScene:transitionContext:completion:] + 1476
21  UIKit                           0x00000001866e6044 -[UIApplication workspaceDidEndTransaction:] + 180
22  FrontBoardServices              0x0000000189edd63c __31-[FBSSerialQueue performAsync:]_block_invoke + 24
23  CoreFoundation                  0x0000000181c66120 __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 16
24  CoreFoundation                  0x0000000181c65228 __CFRunLoopDoBlocks + 308
25  CoreFoundation                  0x0000000181c6384c __CFRunLoopRun + 1752
26  CoreFoundation                  0x0000000181b911f0 CFRunLoopRunSpecific + 392
27  UIKit                           0x00000001864c7788 -[UIApplication _run] + 548
28  UIKit                           0x00000001864c2780 UIApplicationMain + 1484
29  Cloud-Fryser                    0x0000000100044878 main (main.m:16)
30  libdyld.dylib                   0x0000000192e7ea04 start + 0

Thread 1 name:  Dispatch queue: com.apple.libdispatch-manager
Thread 1:
0   libsystem_kernel.dylib          0x0000000192f7cc94 kevent64 + 8
1   libdispatch.dylib               0x0000000192e6497c _dispatch_mgr_invoke + 272
2   libdispatch.dylib               0x0000000192e573b0 _dispatch_mgr_thread + 48

如果您需要更多信息,请告诉我。

【问题讨论】:

我尝试上传到 Test Flight 的应用程序遇到了完全相同的问题。在我尝试的每台设备上都可以正常工作,但被 Apple 拒绝并且崩溃日志显示“未能及时创建场景” - 我尝试在我的设备上以飞行模式运行,但它仍然可以正常启动。 你也用icloud吗? 是的,使用 Tim Roadley Core Data 教程(所以大部分代码都来自那本书)。我确实将 CJPAdController 框架更新到 1.6.1(其中特别提到了线程更新),并且该应用刚刚获得批准! 酷。我认为我的问题是我刚刚将 xcode 更新到 6.0 并将我的设备更新到 8.0。这也让我使用了仅适用于 8.0 的 cloudkit,但我的开发目标是 7.1,因此它不起作用。我认为这就是它崩溃的原因,我正在等待审核我的新版本。 【参考方案1】:

问题很简单。 你只是花太多时间在启动屏幕上加载你的应用程序,ios 设备就会停止你的应用程序。 它只发生在审查中而不是在您测试时发生的原因是因为您总是从 Xcode 运行它,而从 Xcode 运行它不会有这种行为。 如果您将直接从设备运行您的应用程序(通过点击其图标),您将看到它也会在那里发生。假设您在该特定运行上花费了太多时间。

编辑:我还看到您被困在信号量上并且没有使用太多 CPU,这可能意味着您遇到了死锁,导致应用程序在审阅者的设备上停止运行,这就是它花费太多时间加载的原因并且设备会停止您的应用程序。不确定...

如果您有兴趣,这里是我的开发博客文章:

http://pompidev.net/2014/11/16/ios-app-works-on-xcode-but-crash-running-from-device/

【讨论】:

正如我上面写的,我想我找到了问题所在。我在仅适用于 ios 8.0 的应用程序中使用 cloudkit。我的应用程序针对 7.1。当我在装有 ios 7.1 的设备上运行该应用程序时,它没有启动。 问题是您的应用程序在加载屏幕中停顿的时间过长。但是您可能已经找到了导致该停顿的原因。无论如何,您在日志中遇到的错误表明您的应用由于停顿时间过长而被踢到了加载屏幕 以上是问题所在。刚刚获得批准! 谢谢@user1097185,您提到的链接帮助我从设备获取日志文件,使用它我了解启动屏幕所需的 CPU 时间并减少进程,现在可以正常工作:) @user1097185 您提供的链接已失效。

以上是关于应用程序拒绝 - 崩溃报告说:未能及时创建场景 (badf00d) 出了啥问题?的主要内容,如果未能解决你的问题,请参考以下文章

调用核心数据操作时出现“未能及时更新场景”消息崩溃

异常类型:02 异常代码:08badf00d 未能及时启动

SwiftUI 崩溃:“前提条件失败:属性未能设置初始值:71”

使用来自苹果的崩溃报告查找崩溃的根源

React Native ios 应用程序在 xcode 之外运行时崩溃,并且在 19.88 秒后无法创建场景错误

iOS崩溃报告分析