React Native 应用在 iOS 启动时崩溃。

6

我的应用目前相当简单,最复杂的部分是 App.js,以下是它的代码:

import 'react-native-gesture-handler'; // Let me first otherwise I'll break your app in prod 
import 'expo-dev-client';
import * as Sentry from 'sentry-expo';

import React from 'react';
import { NavigationContainer } from '@react-navigation/native';
import MenuDrawer from './src/menu/drawer';
import './src/internationalization/i18n';

Sentry.init({
  dsn: 'DSN',
  enableInExpoDevelopment: process.env.NODE_ENV !== 'test',
  // If `true`, Sentry will try to print out useful debugging information
  // if something goes wrong with sending the event. Set it to `false` in production
  debug: true,
});

export default function App() {
  return (
    <NavigationContainer>
      <MenuDrawer />
    </NavigationContainer>
  );
}

崩溃后的堆栈跟踪如下:

Incident Identifier: 94C73A96-CE6C-46DB-B478-404A657FF429
Hardware Model:      iPhone11,8
Process:             TheVillage [55456]
Path:                /private/var/containers/Bundle/Application/51B553E0-7D46-489E-86F1-A5927E974C53/TheVillage.app/TheVillage
Identifier:          com.thevilage.thevilage
Version:             2.0.0 (61)
AppStoreTools:       13F100
AppVariant:          1:iPhone11,8:15
Beta:                YES
Code Type:           ARM-64 (Native)
Role:                Foreground
Parent Process:      launchd [1]
Coalition:           com.thevilage.thevilage [2490]

Date/Time:           2022-08-24 17:18:57.9504 +0200
Launch Time:         2022-08-24 17:18:57.0965 +0200
OS Version:          iPhone OS 15.6.1 (19G82)
Release Type:        User
Baseband Version:    4.04.02
Report Version:      104

Exception Type:  EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note:  EXC_CORPSE_NOTIFY
Triggered by Thread:  2

Last Exception Backtrace:
0   CoreFoundation                  0x18b13d288 __exceptionPreprocess + 220 (NSException.m:200)
1   libobjc.A.dylib                 0x1a3e6d744 objc_exception_throw + 60 (objc-exception.mm:565)
2   TheVillage          0x1009150b0 RCTFatal + 668 (RCTAssert.m:147)
3   TheVillage          0x100995380 -[RCTExceptionsManager reportFatal:stack:exceptionId:extraDataAsJSON:] + 532 (RCTExceptionsManager.mm:77)
4   TheVillage          0x100995cc0 0x10081c000 + 1547456 (RCTExceptionsManager.mm:147)
5   CoreFoundation                  0x18b0c5b24 __invoking___ + 148 (:-1)
6   CoreFoundation                  0x18b0e3610 -[NSInvocation invoke] + 468 (NSForwarding.m:3378)
7   CoreFoundation                  0x18b11a5fc -[NSInvocation invokeWithTarget:] + 80 (NSForwarding.m:3475)
8   TheVillage          0x1009478fc -[RCTModuleMethod invokeWithBridge:module:arguments:] + 460 (RCTModuleMethod.mm:584)
9   TheVillage          0x100949ef0 facebook::react::invokeInner(RCTBridge*, RCTModuleData*, unsigned int, folly::dynamic const&, int, (anonymous namespace)::SchedulingContext) + 540 (RCTNativeModule.mm:183)
10  TheVillage          0x100949b20 0x10081c000 + 1235744
11  libdispatch.dylib               0x18ada2e6c _dispatch_call_block_and_release + 32 (init.c:1517)
12  libdispatch.dylib               0x18ada4a30 _dispatch_client_callout + 20 (object.m:560)
13  libdispatch.dylib               0x18adac124 _dispatch_lane_serial_drain + 668 (inline_internal.h:2622)
14  libdispatch.dylib               0x18adacc80 _dispatch_lane_invoke + 392 (queue.c:3944)
15  libdispatch.dylib               0x18adb7500 _dispatch_workloop_worker_thread + 648 (queue.c:6732)
16  libsystem_pthread.dylib         0x1fc2fd0bc _pthread_wqthread + 288 (pthread.c:2599)
17  libsystem_pthread.dylib         0x1fc2fce5c start_wqthread + 8 (:-1)

Thread 0 name:
Thread 0:
0   libsystem_kernel.dylib          0x00000001c2bda4a0 mach_msg_trap + 8 (:-1)
1   libsystem_kernel.dylib          0x00000001c2bdaae4 mach_msg + 76 (mach_msg.c:119)
2   CoreFoundation                  0x000000018b0aad30 __CFRunLoopServiceMachPort + 372 (CFRunLoop.c:2646)
3   CoreFoundation                  0x000000018b0af1bc __CFRunLoopRun + 1180 (CFRunLoop.c:3000)
4   CoreFoundation                  0x000000018b0c2bc8 CFRunLoopRunSpecific + 600 (CFRunLoop.c:3268)
5   GraphicsServices                0x00000001a722e374 GSEventRunModal + 164 (GSEvent.c:2200)
6   UIKitCore                       0x000000018da36b58 -[UIApplication _run] + 1100 (UIApplication.m:3511)
7   UIKitCore                       0x000000018d7b8090 UIApplicationMain + 364 (UIApplication.m:5064)
8   TheVillage          0x0000000100822bd0 main + 88 (main.m:7)
9   dyld                            0x0000000100e01da4 start + 520 (dyldMain.cpp:879)

Thread 1:
0   libsystem_pthread.dylib         0x00000001fc2fce54 start_wqthread + 0 (:-1)

Thread 2 name:
Thread 2 Crashed:
0   libsystem_kernel.dylib          0x00000001c2be0b38 __pthread_kill + 8 (:-1)
1   libsystem_pthread.dylib         0x00000001fc3033bc pthread_kill + 268 (pthread.c:1668)
2   libsystem_c.dylib               0x000000019624f524 abort + 168 (abort.c:118)
3   libc++abi.dylib                 0x00000001a3f78b7c abort_message + 132 (abort_message.cpp:78)
4   libc++abi.dylib                 0x00000001a3f689c4 demangling_terminate_handler() + 336 (cxa_default_handlers.cpp:71)
5   libobjc.A.dylib                 0x00000001a3e73c68 _objc_terminate() + 144 (objc-exception.mm:701)
6   libc++abi.dylib                 0x00000001a3f77f18 std::__terminate(void (*)()) + 20 (cxa_handlers.cpp:59)
7   libc++abi.dylib                 0x00000001a3f77eb4 std::terminate() + 64 (cxa_handlers.cpp:88)
8   libdispatch.dylib               0x000000018ada4a44 _dispatch_client_callout + 40 (object.m:563)
9   libdispatch.dylib               0x000000018adac124 _dispatch_lane_serial_drain + 668 (inline_internal.h:2622)
10  libdispatch.dylib               0x000000018adacc80 _dispatch_lane_invoke + 392 (queue.c:3944)
11  libdispatch.dylib               0x000000018adb7500 _dispatch_workloop_worker_thread + 648 (queue.c:6732)
12  libsystem_pthread.dylib         0x00000001fc2fd0bc _pthread_wqthread + 288 (pthread.c:2599)
13  libsystem_pthread.dylib         0x00000001fc2fce5c start_wqthread + 8 (:-1)

Thread 3:
0   libsystem_pthread.dylib         0x00000001fc2fce54 start_wqthread + 0 (:-1)

Thread 4:
0   libsystem_pthread.dylib         0x00000001fc2fce54 start_wqthread + 0 (:-1)

Thread 5:
0   libsystem_pthread.dylib         0x00000001fc2fce54 start_wqthread + 0 (:-1)

Thread 6:
0   libsystem_pthread.dylib         0x00000001fc2fce54 start_wqthread + 0 (:-1)

Thread 7 name:
Thread 7:
0   libsystem_kernel.dylib          0x00000001c2bda4a0 mach_msg_trap + 8 (:-1)
1   libsystem_kernel.dylib          0x00000001c2bdaae4 mach_msg + 76 (mach_msg.c:119)
2   CoreFoundation                  0x000000018b0aad30 __CFRunLoopServiceMachPort + 372 (CFRunLoop.c:2646)
3   CoreFoundation                  0x000000018b0af1bc __CFRunLoopRun + 1180 (CFRunLoop.c:3000)
4   CoreFoundation                  0x000000018b0c2bc8 CFRunLoopRunSpecific + 600 (CFRunLoop.c:3268)
5   Foundation                      0x000000018c8b5444 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 236 (NSRunLoop.m:373)
6   Foundation                      0x000000018c8f6e0c -[NSRunLoop(NSRunLoop) runUntilDate:] + 92 (NSRunLoop.m:420)
7   UIKitCore                       0x000000018d9b0cc4 -[UIEventFetcher threadMain] + 524 (UIEventFetcher.m:1167)
8   Foundation                      0x000000018c90541c __NSThread__start__ + 808 (NSThread.m:972)
9   libsystem_pthread.dylib         0x00000001fc2fd9ac _pthread_start + 148 (pthread.c:891)
10  libsystem_pthread.dylib         0x00000001fc2fce68 thread_start + 8 (:-1)

Thread 8 name:
Thread 8:
0   libsystem_kernel.dylib          0x00000001c2bda4a0 mach_msg_trap + 8 (:-1)
1   libsystem_kernel.dylib          0x00000001c2bdaae4 mach_msg + 76 (mach_msg.c:119)
2   CoreFoundation                  0x000000018b0aad30 __CFRunLoopServiceMachPort + 372 (CFRunLoop.c:2646)
3   CoreFoundation                  0x000000018b0af1bc __CFRunLoopRun + 1180 (CFRunLoop.c:3000)
4   CoreFoundation                  0x000000018b0c2bc8 CFRunLoopRunSpecific + 600 (CFRunLoop.c:3268)
5   TheVillage          0x0000000100928c04 +[RCTCxxBridge runRunLoop] + 264 (RCTCxxBridge.mm:335)
6   Foundation                      0x000000018c90541c __NSThread__start__ + 808 (NSThread.m:972)
7   libsystem_pthread.dylib         0x00000001fc2fd9ac _pthread_start + 148 (pthread.c:891)
8   libsystem_pthread.dylib         0x00000001fc2fce68 thread_start + 8 (:-1)

Thread 9 name:
Thread 9:
0   libsystem_kernel.dylib          0x00000001c2bdaf24 __psynch_cvwait + 8 (:-1)
1   libsystem_pthread.dylib         0x00000001fc304298 _pthread_cond_wait + 1236 (pthread_cond.c:636)
2   JavaScriptCore                  0x00000001963f2148 scavenger_thread_main + 1232 (pas_scavenger.c:135)
3   libsystem_pthread.dylib         0x00000001fc2fd9ac _pthread_start + 148 (pthread.c:891)
4   libsystem_pthread.dylib         0x00000001fc2fce68 thread_start + 8 (:-1)

Thread 10 name:
Thread 10:
0   libsystem_kernel.dylib          0x00000001c2bdaf24 __psynch_cvwait + 8 (:-1)
1   libsystem_pthread.dylib         0x00000001fc304298 _pthread_cond_wait + 1236 (pthread_cond.c:636)
2   JavaScriptCore                  0x0000000196350c20 WTF::ParkingLot::parkConditionallyImpl(void const*, WTF::ScopedLambda<bool ()> const&, WTF::ScopedLambda<void ()> const&, WTF::TimeWithDynamicClockType const&) + 1844 (ThreadingPOSIX.cpp:622)
3   JavaScriptCore                  0x0000000196315c18 bool WTF::Condition::waitUntilUnchecked<WTF::Lock>(WTF::Lock&, WTF::TimeWithDynamicClockType const&) + 308 (ParkingLot.h:82)
4   JavaScriptCore                  0x00000001963160a0 WTF::Detail::CallableWrapper<WTF::AutomaticThread::start(WTF::AbstractLocker const&)::$_0, void>::call() + 260 (Condition.h:77)
5   JavaScriptCore                  0x0000000196371dc4 WTF::Thread::entryPoint(WTF::Thread::NewThreadContext*) + 352 (Function.h:82)
6   JavaScriptCore                  0x00000001963740d0 WTF::wtfThreadEntryPoint(void*) + 16 (ThreadingPOSIX.cpp:242)
7   libsystem_pthread.dylib         0x00000001fc2fd9ac _pthread_start + 148 (pthread.c:891)
8   libsystem_pthread.dylib         0x00000001fc2fce68 thread_start + 8 (:-1)

Thread 11 name:
Thread 11:
0   libsystem_kernel.dylib          0x00000001c2bdaf24 __psynch_cvwait + 8 (:-1)
1   libsystem_pthread.dylib         0x00000001fc304298 _pthread_cond_wait + 1236 (pthread_cond.c:636)
2   JavaScriptCore                  0x0000000196350c20 WTF::ParkingLot::parkConditionallyImpl(void const*, WTF::ScopedLambda<bool ()> const&, WTF::ScopedLambda<void ()> const&, WTF::TimeWithDynamicClockType const&) + 1844 (ThreadingPOSIX.cpp:622)
3   JavaScriptCore                  0x0000000196315c18 bool WTF::Condition::waitUntilUnchecked<WTF::Lock>(WTF::Lock&, WTF::TimeWithDynamicClockType const&) + 308 (ParkingLot.h:82)
4   JavaScriptCore                  0x00000001963160a0 WTF::Detail::CallableWrapper<WTF::AutomaticThread::start(WTF::AbstractLocker const&)::$_0, void>::call() + 260 (Condition.h:77)
5   JavaScriptCore                  0x0000000196371dc4 WTF::Thread::entryPoint(WTF::Thread::NewThreadContext*) + 352 (Function.h:82)
6   JavaScriptCore                  0x00000001963740d0 WTF::wtfThreadEntryPoint(void*) + 16 (ThreadingPOSIX.cpp:242)
7   libsystem_pthread.dylib         0x00000001fc2fd9ac _pthread_start + 148 (pthread.c:891)
8   libsystem_pthread.dylib         0x00000001fc2fce68 thread_start + 8 (:-1)

Thread 12 name:
Thread 12:
0   libsystem_kernel.dylib          0x00000001c2bdaf24 __psynch_cvwait + 8 (:-1)
1   libsystem_pthread.dylib         0x00000001fc304298 _pthread_cond_wait + 1236 (pthread_cond.c:636)
2   JavaScriptCore                  0x0000000196350c20 WTF::ParkingLot::parkConditionallyImpl(void const*, WTF::ScopedLambda<bool ()> const&, WTF::ScopedLambda<void ()> const&, WTF::TimeWithDynamicClockType const&) + 1844 (ThreadingPOSIX.cpp:622)
3   JavaScriptCore                  0x0000000196315c18 bool WTF::Condition::waitUntilUnchecked<WTF::Lock>(WTF::Lock&, WTF::TimeWithDynamicClockType const&) + 308 (ParkingLot.h:82)
4   JavaScriptCore                  0x00000001963160a0 WTF::Detail::CallableWrapper<WTF::AutomaticThread::start(WTF::AbstractLocker const&)::$_0, void>::call() + 260 (Condition.h:77)
5   JavaScriptCore                  0x0000000196371dc4 WTF::Thread::entryPoint(WTF::Thread::NewThreadContext*) + 352 (Function.h:82)
6   JavaScriptCore                  0x00000001963740d0 WTF::wtfThreadEntryPoint(void*) + 16 (ThreadingPOSIX.cpp:242)
7   libsystem_pthread.dylib         0x00000001fc2fd9ac _pthread_start + 148 (pthread.c:891)
8   libsystem_pthread.dylib         0x00000001fc2fce68 thread_start + 8 (:-1)

Thread 13 name:
Thread 13:
0   libsystem_kernel.dylib          0x00000001c2bdaf24 __psynch_cvwait + 8 (:-1)
1   libsystem_pthread.dylib         0x00000001fc304298 _pthread_cond_wait + 1236 (pthread_cond.c:636)
2   JavaScriptCore                  0x0000000196350c20 WTF::ParkingLot::parkConditionallyImpl(void const*, WTF::ScopedLambda<bool ()> const&, WTF::ScopedLambda<void ()> const&, WTF::TimeWithDynamicClockType const&) + 1844 (ThreadingPOSIX.cpp:622)
3   JavaScriptCore                  0x0000000196315c18 bool WTF::Condition::waitUntilUnchecked<WTF::Lock>(WTF::Lock&, WTF::TimeWithDynamicClockType const&) + 308 (ParkingLot.h:82)
4   JavaScriptCore                  0x00000001963160a0 WTF::Detail::CallableWrapper<WTF::AutomaticThread::start(WTF::AbstractLocker const&)::$_0, void>::call() + 260 (Condition.h:77)
5   JavaScriptCore                  0x0000000196371dc4 WTF::Thread::entryPoint(WTF::Thread::NewThreadContext*) + 352 (Function.h:82)
6   JavaScriptCore                  0x00000001963740d0 WTF::wtfThreadEntryPoint(void*) + 16 (ThreadingPOSIX.cpp:242)
7   libsystem_pthread.dylib         0x00000001fc2fd9ac _pthread_start + 148 (pthread.c:891)
8   libsystem_pthread.dylib         0x00000001fc2fce68 thread_start + 8 (:-1)

Thread 14 name:
Thread 14:
0   libsystem_kernel.dylib          0x00000001c2bdaf24 __psynch_cvwait + 8 (:-1)
1   libsystem_pthread.dylib         0x00000001fc304298 _pthread_cond_wait + 1236 (pthread_cond.c:636)
2   JavaScriptCore                  0x0000000196350c20 WTF::ParkingLot::parkConditionallyImpl(void const*, WTF::ScopedLambda<bool ()> const&, WTF::ScopedLambda<void ()> const&, WTF::TimeWithDynamicClockType const&) + 1844 (ThreadingPOSIX.cpp:622)
3   JavaScriptCore                  0x0000000196315c18 bool WTF::Condition::waitUntilUnchecked<WTF::Lock>(WTF::Lock&, WTF::TimeWithDynamicClockType const&) + 308 (ParkingLot.h:82)
4   JavaScriptCore                  0x00000001963160a0 WTF::Detail::CallableWrapper<WTF::AutomaticThread::start(WTF::AbstractLocker const&)::$_0, void>::call() + 260 (Condition.h:77)
5   JavaScriptCore                  0x0000000196371dc4 WTF::Thread::entryPoint(WTF::Thread::NewThreadContext*) + 352 (Function.h:82)
6   JavaScriptCore                  0x00000001963740d0 WTF::wtfThreadEntryPoint(void*) + 16 (ThreadingPOSIX.cpp:242)
7   libsystem_pthread.dylib         0x00000001fc2fd9ac _pthread_start + 148 (pthread.c:891)
8   libsystem_pthread.dylib         0x00000001fc2fce68 thread_start + 8 (:-1)

Thread 15 name:
Thread 15:
0   libsystem_kernel.dylib          0x00000001c2bdaf24 __psynch_cvwait + 8 (:-1)
1   libsystem_pthread.dylib         0x00000001fc304298 _pthread_cond_wait + 1236 (pthread_cond.c:636)
2   JavaScriptCore                  0x0000000196350c20 WTF::ParkingLot::parkConditionallyImpl(void const*, WTF::ScopedLambda<bool ()> const&, WTF::ScopedLambda<void ()> const&, WTF::TimeWithDynamicClockType const&) + 1844 (ThreadingPOSIX.cpp:622)
3   JavaScriptCore                  0x0000000196315c18 bool WTF::Condition::waitUntilUnchecked<WTF::Lock>(WTF::Lock&, WTF::TimeWithDynamicClockType const&) + 308 (ParkingLot.h:82)
4   JavaScriptCore                  0x00000001963160a0 WTF::Detail::CallableWrapper<WTF::AutomaticThread::start(WTF::AbstractLocker const&)::$_0, void>::call() + 260 (Condition.h:77)
5   JavaScriptCore                  0x0000000196371dc4 WTF::Thread::entryPoint(WTF::Thread::NewThreadContext*) + 352 (Function.h:82)
6   JavaScriptCore                  0x00000001963740d0 WTF::wtfThreadEntryPoint(void*) + 16 (ThreadingPOSIX.cpp:242)
7   libsystem_pthread.dylib         0x00000001fc2fd9ac _pthread_start + 148 (pthread.c:891)
8   libsystem_pthread.dylib         0x00000001fc2fce68 thread_start + 8 (:-1)


Thread 2 crashed with ARM Thread State (64-bit):
    x0: 0x0000000000000000   x1: 0x0000000000000000   x2: 0x0000000000000000   x3: 0x0000000000000000
    x4: 0x00000001a3f7c0f5   x5: 0x000000016f6f6430   x6: 0x000000000000006e   x7: 0x0000000000000600
    x8: 0x1bb77aba962a849d   x9: 0x1bb77abbf945f49d  x10: 0x0000000000000200  x11: 0x000000000000000b
   x12: 0x000000000000000b  x13: 0x000000018b47aa9f  x14: 0x00000001a3f7c11b  x15: 0x0000000000000000
   x16: 0x0000000000000148  x17: 0x000000016f6f7000  x18: 0x0000000000000000  x19: 0x0000000000000006
   x20: 0x0000000000002803  x21: 0x000000016f6f70e0  x22: 0x0000000000000000  x23: 0x000000016f6f70e0
   x24: 0x0000000000000000  x25: 0x0000000282347b68  x26: 0x0000000000000114  x27: 0x0000000000000000
   x28: 0x0000000281874440   fp: 0x000000016f6f63a0   lr: 0x00000001fc3033bc
    sp: 0x000000016f6f6380   pc: 0x00000001c2be0b38 cpsr: 0x40000000
   esr: 0x56000080  Address size fault


Binary Images:
0x10081c000 - 0x100adffff TheVillage arm64  <e134bf77b2ad34eb9d5de9ef12b0a84d> /private/var/containers/Bundle/Application/51B553E0-7D46-489E-86F1-A5927E974C53/TheVillage.app/TheVillage
0x100de8000 - 0x100e3ffff dyld arm64e  <66e1fb2668f8379ba052eb8b8291b5e1> /usr/lib/dyld
0x18ada1000 - 0x18ade6fff libdispatch.dylib arm64e  <e3ea4f635d11342aaf199f58dbc8e259> /usr/lib/system/libdispatch.dylib
0x18b0a4000 - 0x18b4f9fff CoreFoundation arm64e  <6b22dd8135853be6bc77ba19810ec0f2> /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation
0x18c89c000 - 0x18cba6fff Foundation arm64e  <ee1abaf23d7137fb906715aa79528619> /System/Library/Frameworks/Foundation.framework/Foundation
0x18d522000 - 0x18edbffff UIKitCore arm64e  <137a95aada6d332cbc01e13bb9b6e317> /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore
0x19622f000 - 0x1962aefff libsystem_c.dylib arm64e  <86a1a24ace353769ba6960f28353281e> /usr/lib/system/libsystem_c.dylib
0x196307000 - 0x19778bfff JavaScriptCore arm64e  <e76b377fc862395a9439d12b09a59e07> /System/Library/Frameworks/JavaScriptCore.framework/JavaScriptCore
0x1a3e57000 - 0x1a3e93fff libobjc.A.dylib arm64e  <f6368be9109b3405b282624040529afd> /usr/lib/libobjc.A.dylib
0x1a3f67000 - 0x1a3f7efff libc++abi.dylib arm64e  <d00067b20a7a3cb9b4d407b160da261b> /usr/lib/libc++abi.dylib
0x1a722d000 - 0x1a7235fff GraphicsServices arm64e  <a094e7b51d4037c5902756d86988ec4b> /System/Library/PrivateFrameworks/GraphicsServices.framework/GraphicsServices
0x1c2bd9000 - 0x1c2c0efff libsystem_kernel.dylib arm64e  <1fb39303587b320eaeb8e51a54c8a4a9> /usr/lib/system/libsystem_kernel.dylib
0x1fc2fc000 - 0x1fc307fff libsystem_pthread.dylib arm64e  <adc41700002e3a2bb4a1eb5fbf575770> /usr/lib/system/libsystem_pthread.dylib

EOF

我已经尝试将Sentry添加到我的应用程序中,但它没有发送任何错误。

附加信息:

  • 在安卓构建上运作正常
  • 该应用程序构建于EAS平台
  • 该应用程序已提交到Testflight(在开发环境下没有错误或警告)
  • 我使用了Expo标准设置
  • 测试套件正常,代码已通过ESLint检验

以下是所有依赖项:

{
  "name": "mobishop",
  "version": "1.0.0",
  "main": "node_modules/expo/AppEntry.js",
  "dependencies": {
    "@babel/preset-env": "^7.18.9",
    "@expo/vector-icons": "^13.0.0",
    "@react-navigation/drawer": "^6.4.3",
    "@react-navigation/native": "^6.0.11",
    "@rneui/base": "^4.0.0-rc.6",
    "@rneui/themed": "^4.0.0-rc.6",
    "@sentry/react-native": "^4.1.3",
    "@testing-library/react-native": "^11.0.0",
    "axios": "^0.27.2",
    "core-js": "^3.24.0",
    "deepmerge": "^4.2.2",
    "dotenv": "^16.0.1",
    "expo": "^46.0.0",
    "expo-application": "~4.2.2",
    "expo-constants": "~13.2.3",
    "expo-dev-client": "~1.2.1",
    "expo-device": "~4.3.0",
    "expo-localization": "~13.1.0",
    "expo-status-bar": "~1.4.0",
    "expo-updates": "~0.14.4",
    "i18next": "^21.8.14",
    "jest-expo": "^46.0.0",
    "prop-types": "^15.8.1",
    "react": "18.0.0",
    "react-dom": "18.0.0",
    "react-i18next": "^11.18.3",
    "react-native": "0.69.4",
    "react-native-dotenv": "^3.3.1",
    "react-native-gesture-handler": "~2.5.0",
    "react-native-reanimated": "~2.9.1",
    "react-native-safe-area-context": "4.3.1",
    "react-native-screens": "~3.15.0",
    "react-native-vector-icons": "^9.2.0",
    "react-native-web": "~0.18.7",
    "react-shallow-renderer": "^16.15.0",
    "sentry-expo": "~5.0.0"
  },
  "devDependencies": {
    "@babel/cli": "^7.18.10",
    "@babel/core": "^7.18.6",
    "@expo/webpack-config": "^0.17.0",
    "@jest/globals": "^28.1.3",
    "babel-plugin-i18next-extract": "^0.9.0-rc",
    "eslint": "^8.20.0",
    "eslint-config-airbnb": "^19.0.4",
    "eslint-plugin-import": "^2.25.3",
    "eslint-plugin-jsx-a11y": "^6.5.1",
    "eslint-plugin-react": "^7.28.0",
    "eslint-plugin-react-hooks": "^4.3.0",
    "eslint-plugin-react-native": "^4.0.0",
    "husky": "^8.0.1",
    "jest": "^26.6.3",
    "react-native-clean-project": "^4.0.1",
    "react-test-renderer": "18.0.0"
  },
  "private": true,
  "jest": {
    "moduleFileExtensions": [
      "js",
      "json",
      "jsx",
      "ts",
      "tsx",
      "node",
      "mjs"
    ],
    "preset": "jest-expo",
    "setupFiles": [
      "<rootDir>/jest/setup.js"
    ],
    "transformIgnorePatterns": [
      "node_modules/(?!((jest-)?react-native|@react-native(-community)?)|expo(nent)?|@expo(nent)?/.*|@expo-google-fonts/.*|react-navigation|@react-navigation/.*|@unimodules/.*|unimodules|sentry-expo|native-base|react-native-svg|@sentry/.*|@rneui/.*)"
    ],
    "transform": {
      "^.+\\.(js|jsx|mjs)$": "babel-jest"
    },
    "collectCoverage": true,
    "collectCoverageFrom": [
      "**/*.{js,jsx}",
      "!**/coverage/**",
      "!**/node_modules/**",
      "!**/babel.config.js",
      "!**/jest.setup.js"
    ]
  }
}

@HamzaHmem 我不知道...它在安卓上运行良好,而且应用程序内部的代码真的不多(除了菜单)。我唯一拥有的就是这个崩溃日志。 - Nek
如果代码基本相同,那么问题可能出在需要在IOS上特别配置的特定库中。这就是为什么您需要使用Xcode运行应用程序来跟踪崩溃,因为所提到的堆栈跟踪没有提供任何有用的信息。 - Hamza Hmem
@HamzaHmem 我从未使用过Xcode,你有关于如何在Xcode中运行应用程序的任何线索吗?(现在它是一个Expo托管的应用程序) - Nek
当然,如果你有一台Mac电脑,而且已经在电脑上安装了Xcode,请按照以下步骤操作: 1- 进入项目根路径下的终端 2- 输入“xed ios”命令或者打开Xcode并点击“打开项目或文件”按钮 - Hamza Hmem
有点晚了,但你能解决这个问题吗?我遇到了完全相同的问题,也不知道是什么原因引起的。甚至对如何更好地调试此问题的帮助也将不胜感激。 - Ken
显示剩余7条评论
1个回答

2

有点晚了,但我在我的Expo项目中也遇到了完全相同的错误,并且通过这篇博客(日语)成功修复了它,也许你也有同样的问题。

本质上,我没有正确地按照React Navigation的安装说明(请参见文档)进行操作。我错过的两个步骤是:

  1. 安装和导入react-native-gesture-handler

注意:如果您正在为Android或iOS构建应用程序,请不要跳过此步骤,否则即使在开发中运行良好,您的应用程序在生产环境中可能会崩溃。其他平台不适用。

  1. 运行npx expo install react-native-screens react-native-safe-area-context

执行这两个命令后,该应用程序在TestFlight中运行良好,我不确定这两个命令是否都是必需的,但最好完全遵循文档。


如我之前分享的代码所述,我已经在做这件事了。但还是谢谢你发布你的解决方案! - Nek
我爱你,非常感谢。 - Jwags

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接