【问题标题】:Expo standalone iOS build crashes on splash screen on Simulator and TestflightExpo 独立 iOS 构建在 Simulator 和 Testflight 的初始屏幕上崩溃
【发布时间】:2021-09-13 13:39:31
【问题描述】:

我使用 Expo 开发了一个市场应用程序。它适用于 Android 和 iOS 上的 Expo Go,以及适用于 Android 的独立应用程序。问题是当我为 iOS 模拟器构建 .tar 或上传到 Testflight 进行测试时。然后它在显示启动画面后立即崩溃。我使用托管工作流程,并且我认为我遵循了所有说明。

这是崩溃日志:

Crashed Thread:        0  Dispatch queue: com.apple.main-thread

Exception Type:        EXC_CRASH (SIGABRT)
Exception Codes:       0x0000000000000000, 0x0000000000000000
Exception Note:        EXC_CORPSE_NOTIFY

Application Specific Information:
*** Terminating app due to uncaught exception 'ExpoFatalError', reason: 'Expo encountered a fatal error: Unhandled JS Exception: Invariant Violation: Native module cannot be null.'
terminating with uncaught exception of type NSException
abort() called
CoreSimulator 757.5 - Device: iPhone 12 (0D59D0C0-2D3B-40ED-A8E2-DA0B1417C29C) - Runtime: iOS 14.5 (18E182) - DeviceType: iPhone 12

    Application Specific Backtrace 1:
    0   CoreFoundation                      0x00007fff20422fba __exceptionPreprocess + 242
    1   libobjc.A.dylib                     0x00007fff20193ff5 objc_exception_throw + 48
    2   ComGrabbiGrabbiapp                  0x000000010b375821 -[EXAppViewController maybeShowError:] + 506
    3   ComGrabbiGrabbiapp                  0x000000010b396dce handleFatalReactError_block_invoke_2 + 574
    4   libdispatch.dylib                   0x00007fff201078df _dispatch_client_callout + 8
    5   libdispatch.dylib                   0x00007fff201156ca _dispatch_async_and_wait_invoke + 109
    6   libdispatch.dylib                   0x00007fff201078df _dispatch_client_callout + 8
    7   libdispatch.dylib                   0x00007fff20114a27 _dispatch_main_queue_callback_4CF + 1045
    8   CoreFoundation                      0x00007fff203908f8 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
    9   CoreFoundation                      0x00007fff2038b169 __CFRunLoopRun + 2781
    10  CoreFoundation                      0x00007fff2038a1a7 CFRunLoopRunSpecific + 567
    11  GraphicsServices                    0x00007fff2b874d85 GSEventRunModal + 139
    12  UIKitCore                           0x00007fff246c14df -[UIApplication _run] + 912
    13  UIKitCore                           0x00007fff246c639c UIApplicationMain + 101
    14  ComGrabbiGrabbiapp                  0x000000010b1461d0 main + 80
    15  libdyld.dylib                       0x00007fff2025abbd start + 1
    
    Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
    0   libsystem_kernel.dylib          0x00007fff60309946 __pthread_kill + 10
    1   libsystem_pthread.dylib         0x00007fff60343615 pthread_kill + 263
    2   libsystem_c.dylib               0x00007fff200fbd4f __abort + 139
    3   libsystem_c.dylib               0x00007fff200fbcc4 abort + 135
    4   libc++abi.dylib                 0x00007fff20254692 abort_message + 241
    5   libc++abi.dylib                 0x00007fff20245dfd demangling_terminate_handler() + 266
    6   libobjc.A.dylib                 0x00007fff20179ace _objc_terminate() + 96
    7   libc++abi.dylib                 0x00007fff20253aa7 std::__terminate(void (*)()) + 8
    8   libc++abi.dylib                 0x00007fff20253a49 std::terminate() + 41
    9   libdispatch.dylib               0x00007fff201078f3 _dispatch_client_callout + 28
    10  libdispatch.dylib               0x00007fff201156ca _dispatch_async_and_wait_invoke + 109
    11  libdispatch.dylib               0x00007fff201078df _dispatch_client_callout + 8
    12  libdispatch.dylib               0x00007fff20114a27 _dispatch_main_queue_callback_4CF + 1045
    13  com.apple.CoreFoundation        0x00007fff203908f8 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
    14  com.apple.CoreFoundation        0x00007fff2038b169 __CFRunLoopRun + 2781
    15  com.apple.CoreFoundation        0x00007fff2038a1a7 CFRunLoopRunSpecific + 567
    16  com.apple.GraphicsServices      0x00007fff2b874d85 GSEventRunModal + 139
    17  com.apple.UIKitCore             0x00007fff246c14df -[UIApplication _run] + 912
    18  com.apple.UIKitCore             0x00007fff246c639c UIApplicationMain + 101
    19  com.grabbi.grabbiapp            0x000000010b1461d0 main + 80
    20  libdyld.dylib                   0x00007fff2025abbd start + 1

【问题讨论】:

    标签: ios crash expo ios-simulator testflight


    【解决方案1】:

    好的,经过一个周末的调试,我修复了它。我将我的主要应用程序组件(在 Expo 中)包装在 Stripe Provider 组件中。由于我没有使用 Stripe 而是使用 Paypal 进行结帐,因此我删除了 Stripe 包装器,现在它可以工作了。

      if(fontsLoaded){
    return (
        <StripeProvider
            publishableKey="xxxxxxxxxxxxxxxxx"
            urlScheme="your-url-scheme" // required for 3D Secure and bank redirects
            merchantIdentifier="merchant.com.{{YOUR_APP_NAME}}" // required for Apple Pay
        >
          <Provider store={store}>
            <PersistGate loading={null} persistor={persistor}>
              <RootRouter />
            </PersistGate>
          </Provider>
        </StripeProvider>
    );
    

    【讨论】:

      猜你喜欢
      • 2021-10-27
      • 2017-05-08
      • 2021-09-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-02-11
      • 2017-11-06
      • 2021-10-25
      相关资源
      最近更新 更多