ReactNative app crashes on launch when downloaded from AppCenter

My ReactNative app works fine when I run it locally via Xcode in a simulator or on phone. However, when I use AppCenter to build the app and download it for testing, it crashes on launch with the following crash exception (I've attached complete crash report as a .txt file):

Exception Type: EXC_CRASH (SIGABRT) Exception Codes: 0x0000000000000000, 0x0000000000000000 Termination Reason: SIGNAL 6 Abort trap: 6 Terminating Process: budget [1014] Triggered by Thread: 0 Application Specific Information: abort() called

Kernel Triage: VM - (arg = 0x0) pmap_enter retried due to resource shortage VM - (arg = 0x0) pmap_enter retried due to resource shortage VM - (arg = 0x0) pmap_enter retried due to resource shortage

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

Thread 0 Crashed:

0 libsystem_kernel.dylib 0x1f8771578 __pthread_kill + 8 1 libsystem_pthread.dylib 0x2195ec118 pthread_kill + 268 2 libsystem_c.dylib 0x1c0cdc178 abort + 180 3 libswiftCore.dylib 0x104690028 swift::fatalError(unsigned int, char const*, ...) + 56 4 libswiftCore.dylib 0x1046881c8 checkVersion() + 60 5 dyld 0x1d8d731cc invocation function for block in dyld4::Loader::findAndRunAllInitializers(dyld4::RuntimeState&) const::$_0::operator()() const + 168 6 dyld 0x1d8da5af0 invocation function for block in dyld3::MachOAnalyzer::forEachInitializer(Diagnostics&, dyld3::MachOAnalyzer::VMAddrConverter const&, void (unsigned int) block_pointer, void const*) const + 172 7 dyld 0x1d8d4c8a0 invocation function for block in dyld3::MachOFile::forEachSection(void (dyld3::MachOFile::SectionInfo const&, bool, bool&) block_pointer) const + 528 8 dyld 0x1d8d4bc18 dyld3::MachOFile::forEachLoadCommand(Diagnostics&, void (load_command const*, bool&) block_pointer) const + 296 9 dyld 0x1d8d4b1b0 dyld3::MachOFile::forEachSection(void (dyld3::MachOFile::SectionInfo const&, bool, bool&) block_pointer) const + 192 10 dyld 0x1d8d9e8dc dyld3::MachOFile::forEachInitializerPointerSection(Diagnostics&, void (unsigned int, unsigned int, bool&) block_pointer) const + 160 11 dyld 0x1d8d570bc dyld3::MachOAnalyzer::forEachInitializer(Diagnostics&, dyld3::MachOAnalyzer::VMAddrConverter const&, void (unsigned int) block_pointer, void const*) const + 432 12 dyld 0x1d8d538d8 dyld4::Loader::findAndRunAllInitializers(dyld4::RuntimeState&) const + 448 13 dyld 0x1d8d4fd4c dyld4::Loader::runInitializersBottomUp(dyld4::RuntimeState&, dyld3::Array<dyld4::Loader const*>&) const + 220 14 dyld 0x1d8d4fd28 dyld4::Loader::runInitializersBottomUp(dyld4::RuntimeState&, dyld3::Array<dyld4::Loader const*>&) const + 184 15 dyld 0x1d8d4fd28 dyld4::Loader::runInitializersBottomUp(dyld4::RuntimeState&, dyld3::Array<dyld4::Loader const*>&) const + 184 16 dyld 0x1d8d73258 dyld4::Loader::runInitializersBottomUpPlusUpwardLinks(dyld4::RuntimeState&) const::$_1::operator()() const + 112 17 dyld 0x1d8d556a0 dyld4::Loader::runInitializersBottomUpPlusUpwardLinks(dyld4::RuntimeState&) const + 304 18 dyld 0x1d8d8b244 dyld4::APIs::runAllInitializersForMain() + 340 19 dyld 0x1d8d5f03c dyld4::prepare(dyld4::APIs&, dyld3::MachOAnalyzer const*) + 3404

20 dyld 0x1d8d5ccdc start + 1948

Consider this:

OS Version:          iPhone OS 16.6 (20G75)

And this:

0x10440c000 -        0x10472bfff libswiftCore.dylib arm64   /private/var/containers/Bundle/Application/F75DB8C7-D5BA-4DF6-BBD2-03F73775C2F7/budget.app/Frameworks/libswiftCore.dylib

Your app is running on a really recent of macOS, but it’s managed to load the Swift runtime that’s bundled within the app. Your app should be using the system runtime in /usr/lib/swift.

This crash is typically caused by a mixed up rpath, where the rpath entry for /usr/lib/swift is listed after the one for @executable_path/Frameworks.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

@eskimo Thank you for your comment.

RunPaths for my project looks like as shown below: Debug: /usr/lib/swift /usr/lib/swift '@executable_path/Frameworks' '@loader_path/Frameworks' @executable_path/Frameworks' Release: /usr/lib/swift /usr/lib/swift '@executable_path/Frameworks' '@loader_path/Frameworks' @executable_path/Frameworks'

Also, The app runs when I run it on iPhone OS version 12.1, but starts failing from 12.2 onwards. Pervious version of the app works for even iPhone OS 16.x.

ReactNative app crashes on launch when downloaded from AppCenter
 
 
Q