简体   繁体   中英

iOS React Native app runs perfectly in testing but crashes in release build

I wrote a simple app with React Native targeting iOS. When I build the app in Xcode to test on simulators or my iPhone everything works perfectly. When I archive the build in Xcode and load it on my iPhone using the development option, it crashes when I press the only button on screen on start.

The app source code can be found on GitHub .

I am using React Native ~0.63.4 and React: 16.13.1 in a bare Expo workflow.
Third party dependencies:

@react-native-async-storage/async-storage
expo-constants
expo-notifications
uuid
react-native-date-picker

Here is a full crash report from the device logs: Google Drive

I'm at a loss trying to interpret the crash logs but the thread that crashes is exactly this everytime (except for the thread number):

Thread 3 name:  Dispatch queue: com.facebook.react.ExceptionsManagerQueue
Thread 3 Crashed:
0   libsystem_kernel.dylib          0x00000001d285f414 __pthread_kill + 8
1   libsystem_pthread.dylib         0x00000001eed77b40 pthread_kill + 272
2   libsystem_c.dylib               0x00000001aec84b74 abort + 104
3   libc++abi.dylib                 0x00000001b9fbccf8 __cxxabiv1::__aligned_malloc_with_fallback+ 81144 (unsigned long) + 0
4   libc++abi.dylib                 0x00000001b9fade4c demangling_unexpected_handler+ 20044 () + 0
5   libobjc.A.dylib                 0x00000001b9eb6f64 _objc_terminate+ 28516 () + 144
6   libc++abi.dylib                 0x00000001b9fbc0e0 std::__terminate(void (*)+ 78048 ()) + 20
7   libc++abi.dylib                 0x00000001b9fbc06c std::terminate+ 77932 () + 44
8   libdispatch.dylib               0x00000001a5554dc4 _dispatch_client_callout + 40
9   libdispatch.dylib               0x00000001a555c10c _dispatch_lane_serial_drain + 580
10  libdispatch.dylib               0x00000001a555cc5c _dispatch_lane_invoke + 408
11  libdispatch.dylib               0x00000001a5566d78 _dispatch_workloop_worker_thread + 708
12  libsystem_pthread.dylib         0x00000001eed78804 _pthread_wqthread + 276
13  libsystem_pthread.dylib         0x00000001eed7f75c start_wqthread + 8

When I open the app while connected to my laptop and have the console for my iPhone open while crashing the app, I first get these messages under Errors and Faults:

error   16:14:06.383233-0500    remindrs    Error: Requiring unknown module "undefined".
error   16:14:06.386759-0500    remindrs    Unhandled JS Exception: Error: Requiring unknown module "undefined".
error   16:14:06.463315-0500    SpringBoard Ignoring state for untracked process [application<org.name.remindrs>:5966]: <RBSProcessState| task:none debug:none>
fault   16:14:06.559231-0500    SpringBoard Unable to move topic <private>, This topic was not in the list provided! APSTopicListOpportunistic

I've tried cleaning the build folder, turning off Swift compiler optimizations, and rearchived the project multiple times.

None of my searching has paid off and I'm not sure how to identify the issue I am having. I don't know if it is with React Native or with some configuration in Xcode.

Thank you for your help!

I solved the problem by removing a few lines of codes dealing with a Date. I'm not sure why this caused a crash in release and not debug but the problem is fixed!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM