簡體   English   中英

React Native Firebase 推送通知崩潰報告問題

[英]React Native Firebase Push Notification Crash Report Problem

我正在使用 React Native 構建一個應用程序。 使用 React Native Firebase,我正在添加推送通知功能。 當我從退出 state 打開推送通知時,應用程序打開並在初始屏幕上掛起一段時間,然后崩潰。

這是來自設備的崩潰報告,符號化。 老實說,我是編程新手,所以我在解釋下面的報告時遇到了麻煩。 我認為 RNSplashScreen 模塊或 AppDelegate.m 存在問題,但不能確定。

誰能幫助我解釋這一點並指出可能的根本原因/從哪里看?

謝謝!

    Exception Type:  EXC_CRASH (SIGKILL)
    Exception Codes: 0x0000000000000000, 0x0000000000000000
    Exception Note:  EXC_CORPSE_NOTIFY
    Termination Reason: Namespace SPRINGBOARD, Code 0x8badf00d
    Termination Description: SPRINGBOARD, <RBSTerminateContext| domain:10 code:0x8BADF00D explanation:scene-create watchdog transgression: application<myapp.myapp>:2661 exhausted real (wall clock) time allowance of 59.91 seconds | ProcessVisibility: Foreground | ProcessState: Running | WatchdogEvent: scene-create | WatchdogVisibility: Background | WatchdogCPUStatistics: ( | "Elapsed total CPU time (seconds): 16.580 (user 16.580, system 0.000), 5% CPU", | "Elapsed application CPU time (seconds): 0.918, 0% CPU" | ) reportType:CrashLog maxTerminationResistance:Interactive>
    Triggered by Thread:  0

    Thread 0 name:  Dispatch queue: com.apple.main-thread
    Thread 0 Crashed:
    0   libsystem_kernel.dylib          0x00000001daebe2d0 mach_msg_trap + 8
    1   libsystem_kernel.dylib          0x00000001daebd660 mach_msg + 76
    2   CoreFoundation                  0x00000001acf08c30 __CFRunLoopServiceMachPort + 380
    3   CoreFoundation                  0x00000001acf02c14 __CFRunLoopRun + 1216
    4   CoreFoundation                  0x00000001acf0221c CFRunLoopRunSpecific + 600
    5   Foundation                      0x00000001ae1b1df0 -[NSRunLoop+ 36336 (NSRunLoop) runMode:beforeDate:] + 232
    6   Foundation                      0x00000001ae1b1cbc -[NSRunLoop+ 36028 (NSRunLoop) runUntilDate:] + 92
    7   myapp                           0x00000001005d15f0 +[RNSplashScreen show] (in myapp) (RNSplashScreen.m:31) + 5641712
    8   myapp                           0x0000000100075be4 -[AppDelegate application:didFinishLaunchingWithOptions:] (in myapp) (AppDelegate.m:53) + 23524
    9   UIKitCore                       0x00000001af93f228 -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 360
    10  UIKitCore                       0x00000001af941290 -[UIApplication _callInitializationDelegatesWithActions:forCanvas:payload:fromOriginatingProcess:] + 5136
    11  UIKitCore                       0x00000001af946cec -[UIApplication _runWithMainScene:transitionContext:completion:] + 1244
    12  UIKitCore                       0x00000001aef9cc74 -[_UISceneLifecycleMultiplexer completeApplicationLaunchWithFBSScene:transitionContext:] + 152
    13  UIKitCore                       0x00000001af50af9c _UIScenePerformActionsWithLifecycleActionMask + 112
    14  UIKitCore                       0x00000001aef9d80c __101-[_UISceneLifecycleMultiplexer _evalTransitionToSettings:fromSettings:forceExit:withTransitionStore:]_block_invoke + 224
    15  UIKitCore                       0x00000001aef9d2cc -[_UISceneLifecycleMultiplexer _performBlock:withApplicationOfDeactivationReasons:fromReasons:] + 484
    16  UIKitCore                       0x00000001aef9d61c -[_UISceneLifecycleMultiplexer _evalTransitionToSettings:fromSettings:forceExit:withTransitionStore:] + 768
    17  UIKitCore                       0x00000001aef9ce58 -[_UISceneLifecycleMultiplexer uiScene:transitionedFromState:withTransitionContext:] + 340
    18  UIKitCore                       0x00000001aefa53a4 __186-[_UIWindowSceneFBSSceneTransitionContextDrivenLifecycleSettingsDiffAction _performActionsForUIScene:withUpdatedFBSScene:settingsDiff:fromSettings:transitionContext:lifecycleActionType:]_block_invoke + 196
    19  UIKitCore                       0x00000001af41760c +[BSAnimationSettings+ 6936076 (UIKit) tryAnimatingWithSettings:actions:completion:] + 892
    20  UIKitCore                       0x00000001af5236c4 _UISceneSettingsDiffActionPerformChangesWithTransitionContext + 272
    21  UIKitCore                       0x00000001aefa509c -[_UIWindowSceneFBSSceneTransitionContextDrivenLifecycleSettingsDiffAction _performActionsForUIScene:withUpdatedFBSScene:settingsDiff:fromSettings:transitionContext:lifecycleActionType:] + 384
    22  UIKitCore                       0x00000001aedcc5a0 __64-[UIScene scene:didUpdateWithDiff:transitionContext:completion:]_block_invoke + 776
    23  UIKitCore                       0x00000001aedcaf14 -[UIScene _emitSceneSettingsUpdateResponseForCompletion:afterSceneUpdateWork:] + 256
    24  UIKitCore                       0x00000001aedcc1c8 -[UIScene scene:didUpdateWithDiff:transitionContext:completion:] + 248
    25  UIKitCore                       0x00000001af944e8c -[UIApplication workspace:didCreateScene:withTransitionContext:completion:] + 572
    26  UIKitCore                       0x00000001af440e38 -[UIApplicationSceneClientAgent scene:didInitializeWithEvent:completion:] + 388
    27  FrontBoardServices              0x00000001bccf83bc -[FBSScene _callOutQueue_agent_didCreateWithTransitionContext:completion:] + 432
    28  FrontBoardServices              0x00000001bcd23d04 __94-[FBSWorkspaceScenesClient createWithSceneID:groupID:parameters:transitionContext:completion:]_block_invoke.200 + 128
    29  FrontBoardServices              0x00000001bcd074a0 -[FBSWorkspace _calloutQueue_executeCalloutFromSource:withBlock:] + 240
    30  FrontBoardServices              0x00000001bcd239c8 __94-[FBSWorkspaceScenesClient createWithSceneID:groupID:parameters:transitionContext:completion:]_block_invoke + 372
    31  libdispatch.dylib               0x00000001acb81db0 _dispatch_client_callout + 20
    32  libdispatch.dylib               0x00000001acb85738 _dispatch_block_invoke_direct + 268
    33  FrontBoardServices              0x00000001bcd4c250 __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 48
    34  FrontBoardServices              0x00000001bcd4bee0 -[FBSSerialQueue _targetQueue_performNextIfPossible] + 448
    35  FrontBoardServices              0x00000001bcd4c434 -[FBSSerialQueue _performNextFromRunLoopSource] + 32
    36  CoreFoundation                  0x00000001acf0976c __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 28
    37  CoreFoundation                  0x00000001acf09668 __CFRunLoopDoSource0 + 208
    38  CoreFoundation                  0x00000001acf08960 __CFRunLoopDoSources0 + 268
    39  CoreFoundation                  0x00000001acf02a8c __CFRunLoopRun + 824
    40  CoreFoundation                  0x00000001acf0221c CFRunLoopRunSpecific + 600
    41  GraphicsServices                0x00000001c4ace784 GSEventRunModal + 164
    42  UIKitCore                       0x00000001af942ee8 -[UIApplication _run] + 1072
    43  UIKitCore                       0x00000001af94875c UIApplicationMain + 168
    44  myapp                       0x0000000100075db4 main (in myapp) (main.m:7) + 23988
    45  libdyld.dylib                   0x00000001acbc26b0 start + 4

在我的項目中添加 React Native Firebase 后我遇到了同樣的問題,並在這個問題中找到了答案: https://github.com/crazycodeboy/react-native-splash-screen/issues/397

真正的原因在於 react-native-splash-screen。 Firebase 需要更改應用程序功能中的“背景模式”,這會導致 react-native-splash-screen 到 go 進入 RNSplashScreen.m 中的循環:

while (waiting) {
    NSDate* later = [NSDate dateWithTimeIntervalSinceNow:0.1];
    [[NSRunLoop mainRunLoop] runUntilDate:later];
}

您可以在回溯的這一部分找到它:

5   Foundation                      0x00000001ae1b1df0 -[NSRunLoop+ 36336 (NSRunLoop) runMode:beforeDate:] + 232
6   Foundation                      0x00000001ae1b1cbc -[NSRunLoop+ 36028 (NSRunLoop) runUntilDate:] + 92
7   myapp                           0x00000001005d15f0 +[RNSplashScreen show] (in myapp) (RNSplashScreen.m:31) + 5641712

要解決您需要修改 AppDelegate.m 的問題,請替換

[RNSplashScreen show]

[RNSplashScreen showSplash:@"LaunchScreen" inRootView:rootView];

但要小心,如果您的項目使用 LaunchScreen.storyboard 而不是 LaunchScreen.xib,您可能會遇到此錯誤:

*** 由於未捕獲的異常“NSInternalInconsistencyException”而終止應用程序,原因:“無法在包中加載 NIB:'NSBundle </private/var/containers/Bundle/Application/D22A78C5-5733-4511-85BF-217A3BAEB6AB/myapp.app >(已加載)',名稱為'LaunchScreen''

在這種情況下,您需要創建名為“LaunchScreen”的新視圖,並將 LaunchScreen.storyboard 中的啟動視圖復制粘貼到此處。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM