在iOS 12设备上从App Store下载的iOS应用在启动时崩溃。

问题描述 投票:0回答:1

我有一个iOS应用程序,在所有设备上工作得非常好,除非他们使用iOS 12。我不确定问题出在哪里。我试过直接从我的笔记本电脑上下载应用程序,它工作得很好。但是,当它从App Store或TestFlight下载时,它在启动时崩溃。

这是我的崩溃日志。

Exception Type:  EXC_CRASH (SIGKILL)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note:  EXC_CORPSE_NOTIFY
Termination Reason: Namespace SPRINGBOARD, Code 0x8badf00d
Termination Description: SPRINGBOARD, scene-create watchdog transgression: com.X.X exhausted real (wall clock) time allowance of 18.98 seconds | ProcessVisibility: Background | ProcessState: Running | WatchdogEvent: scene-create | WatchdogVisibility: Foreground | WatchdogCPUStatistics: ( | "Elapsed total CPU time (seconds): 4.380 (user 4.380, system 0.000), 24% CPU", | "Elapsed application CPU time (seconds): 1.411, 8% CPU" | )
Triggered by Thread:  0

Thread 0 name:  Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0   libsystem_kernel.dylib          0x000000018b1f6ac4 __msync + 8
1   Realm                           0x0000000101485044 realm::util::msync+ 3117124 (int, void*, unsigned long) + 216
2   Realm                           0x0000000101391078 realm::GroupWriter::commit+ 2117752 (unsigned long) + 264
3   Realm                           0x000000010138bde0 realm::SharedGroup::low_level_commit+ 2096608 (unsigned long long) + 344
4   Realm                           0x000000010138b978 realm::SharedGroup::do_commit+ 2095480 () + 96
5   Realm                           0x000000010138c184 realm::SharedGroup::commit_and_continue_as_read+ 2097540 () + 44
6   Realm                           0x00000001011ceccc realm::_impl::RealmCoordinator::commit_write+ 273612 (realm::Realm&) + 76
7   Realm                           0x00000001012a20f8 realm::Realm::commit_transaction+ 1138936 () + 168
8   Realm                           0x0000000101271628 -[RLMRealm commitWriteTransactionWithoutNotifying:error:] + 288
9   RealmSwift                      0x000000010172826c Realm.write<A>(withoutNotifying:_:) + 115308 (Realm.swift:280)
10  MYAPP                           0x0000000100c7f820 specialized JSONSerializer.serialize(input:) + 178208 (JSONSerializer.swift:30)
11  MYAPP                           0x0000000100cd6fa4 specialized AppDelegate.setUpRealm() + 536484 (AppDelegate.swift:235)
12  MYAPP                           0x0000000100cd5e14 @objc AppDelegate.application(_:didFinishLaunchingWithOptions:) + 531988 (<compiler-generated>:20)
13  UIKitCore                       0x00000001b7e400f0 -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 412
14  UIKitCore                       0x00000001b7e41854 -[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] + 3352
15  UIKitCore                       0x00000001b7e46fe0 -[UIApplication _runWithMainScene:transitionContext:completion:] + 1540
16  UIKitCore                       0x00000001b770a2a4 __111-[__UICanvasLifecycleMonitor_Compatability _scheduleFirstCommitForScene:transition:firstActivation:completion:]_block_invoke + 776
17  UIKitCore                       0x00000001b771283c +[_UICanvas _enqueuePostSettingUpdateTransactionBlock:] + 160
18  UIKitCore                       0x00000001b7709f28 -[__UICanvasLifecycleMonitor_Compatability _scheduleFirstCommitForScene:transition:firstActivation:completion:] + 236
19  UIKitCore                       0x00000001b770a818 -[__UICanvasLifecycleMonitor_Compatability activateEventsOnly:withContext:completion:] + 1064
20  UIKitCore                       0x00000001b7708b64 __82-[_UIApplicationCanvas _transitionLifecycleStateWithTransitionContext:completion:]_block_invoke + 744
21  UIKitCore                       0x00000001b770882c -[_UIApplicationCanvas _transitionLifecycleStateWithTransitionContext:completion:] + 428
22  UIKitCore                       0x00000001b770d36c __125-[_UICanvasLifecycleSettingsDiffAction performActionsForCanvas:withUpdatedScene:settingsDiff:fromSettings:transitionContext:]_block_invoke + 220
23  UIKitCore                       0x00000001b770e150 _performActionsWithDelayForTransitionContext + 112
24  UIKitCore                       0x00000001b770d224 -[_UICanvasLifecycleSettingsDiffAction performActionsForCanvas:withUpdatedScene:settingsDiff:fromSettings:transitionContext:] + 244
25  UIKitCore                       0x00000001b7711f24 -[_UICanvas scene:didUpdateWithDiff:transitionContext:completion:] + 360
26  UIKitCore                       0x00000001b7e455e8 -[UIApplication workspace:didCreateScene:withTransitionContext:completion:] + 540
27  UIKitCore                       0x00000001b7a41e04 -[UIApplicationSceneClientAgent scene:didInitializeWithEvent:completion:] + 360
28  FrontBoardServices              0x000000018dfd79fc -[FBSSceneImpl _didCreateWithTransitionContext:completion:] + 440
29  FrontBoardServices              0x000000018dfe140c __56-[FBSWorkspace client:handleCreateScene:withCompletion:]_block_invoke_2 + 256
30  FrontBoardServices              0x000000018dfe0c14 __40-[FBSWorkspace _performDelegateCallOut:]_block_invoke + 64
31  libdispatch.dylib               0x000000018b0997d4 _dispatch_client_callout + 16
32  libdispatch.dylib               0x000000018b03e5dc _dispatch_block_invoke_direct$VARIANT$mp + 224
33  FrontBoardServices              0x000000018e012040 __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 40
34  FrontBoardServices              0x000000018e011cdc -[FBSSerialQueue _performNext] + 408
35  FrontBoardServices              0x000000018e012294 -[FBSSerialQueue _performNextFromRunLoopSource] + 52
36  CoreFoundation                  0x000000018b5ecf1c __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24
37  CoreFoundation                  0x000000018b5ece9c __CFRunLoopDoSource0 + 88
38  CoreFoundation                  0x000000018b5ec784 __CFRunLoopDoSources0 + 176
39  CoreFoundation                  0x000000018b5e76c0 __CFRunLoopRun + 1004
40  CoreFoundation                  0x000000018b5e6fb4 CFRunLoopRunSpecific + 436
41  GraphicsServices                0x000000018d7e879c GSEventRunModal + 104
42  UIKitCore                       0x00000001b7e48c38 UIApplicationMain + 212
43  MYAPP                           0x0000000100c5a274 main + 25204 (LanguageExampleCell.swift:16)
44  libdyld.dylib                   0x000000018b0aa8e0 start + 4

我在第一次启动应用程序时,就把一个大型的Realm数据库序列化了 I serialize a large Realm database the first time the app launch. 这是导致问题的原因吗?我没有办法找出答案,因为当我通过电脑安装应用时不会发生这种情况。

ios swift xcode realm
1个回答
2
投票

8badfood 是一个看门狗定时器异常。你必须退出 didFinishLaunching 与尽快呈现一个视图。

如果你必须加载大量的数据,那么你应该呈现一个初始的 "加载 "视图,并执行加载,一旦加载完成就转到实际的UI。

这是为了避免给用户留下应用刚刚 "挂掉 "的印象。

事实上,你只有在iOS 12设备上才会出现崩溃的情况,这可能是因为它们是较老、较慢的设备。

© www.soinside.com 2019 - 2024. All rights reserved.