React Native app crash on splash screen in release mode. In debug everything ok.

React Native app crash on splash screen in release mode. In debug everything ok. Here is the error from XCode console.

*** Terminating app due to uncaught exception 'RCTFatalException: Unhandled JS Exception: Error: invalid host', reason: 'Unhandled JS Exception: Error: invalid host, stack: <unknown>@732:405 value@731:2737 <unknown>@719:2589 h@2:1587 <unknown>@718:591 h@2:1587 <unknown>@708:753 h@2:1587 <unknown>@6:206 h@2:1587 d@2:960 global code@5698:3 ' *** First throw call stack: ( 0 CoreFoundation 0x00000001107ae28d _exceptionPreprocess + 242 1 libobjc.A.dylib 0x0000000112157894 objc_exception_throw + 48 2 React 0x000000011043f1e8 RCTGetFatalHandler + 0 3 Rhino Dev 0x00000001043ed498 -[RCTExceptionsManager reportFatal:stack:exceptionId:] + 508 4 Rhino Dev 0x00000001043ede39 -[RCTExceptionsManager reportException:] + 1620 5 CoreFoundation 0x00000001107b4ebc invoking + 140 6 CoreFoundation 0x00000001107b21df -[NSInvocation invoke] + 302 7 CoreFoundation 0x00000001107b244f -[NSInvocation invokeWithTarget:] + 70 8 React 0x000000011047668b -[RCTModuleMethod invokeWithBridge:module:arguments:] + 583 9 React 0x0000000110478db0 _ZN8facebook5reactL11invokeInnerEP9RCTBridgeP13RCTModuleDatajRKN5folly7dynamicEiN12_GLOBAL__N_117SchedulingContextE + 574 10 React 0x00000001104789ad ___ZN8facebook5react15RCTNativeModule6invokeEjON5folly7dynamicEi_block_invoke + 110 11 libdispatch.dylib 0x000000011554e747 _dispatch_call_block_and_release + 12 12 libdispatch.dylib 0x000000011554f9f7 _dispatch_client_callout + 8 13 libdispatch.dylib 0x00000001155578c9 _dispatch_lane_serial_drain + 1127 14 libdispatch.dylib 0x0000000115558665 _dispatch_lane_invoke + 441 15 libdispatch.dylib 0x000000011556576e _dispatch_root_queue_drain_deferred_wlh + 318 16 libdispatch.dylib 0x0000000115564b69 _dispatch_workloop_worker_thread + 590 17 libsystem_pthread.dylib 0x0000000115a4ec47 _pthread_wqthread + 327 18 libsystem_pthread.dylib 0x0000000115a4db97 start_wqthread + 15 ) libc++abi: terminating due to uncaught exception of type NSException

I am having the exact problem. It is only happening when i bundle in Release. Debug works fine, but the same. Crashes on the slash screen.

Exception NSException * "Unhandled JS Exception: Error: invalid host, stack:\n<unknown>@460:405\nvalue@459:2680\n<unknown>@459:446\n<unknown>@457:2528\nh@2:1707\n<unknown>@456:578\nh@2:1707\n<unknown>@455:117\nh@2:1707\n<unknown>@430:168\nh@2:1707\n<unknown>@385:1540\nh@2:1707\n<unknown>@6:72\nh@2:1707\nd@2:1080\nglobal code@4034:3\n" 0x0000600000c65980

Unhandled JS Exception: Error: invalid host, stack: <unknown>@460:405 value@459:2680 <unknown>@459:446 <unknown>@457:2528 h@2:1707 <unknown>@456:578 h@2:1707 <unknown>@455:117 h@2:1707 <unknown>@430:168 h@2:1707 <unknown>@385:1540 h@2:1707 <unknown>@6:72 h@2:1707 d@2:1080 global code@4034:3 ( 0 CoreFoundation 0x0000000180491128 _exceptionPreprocess + 172 1 libobjc.A.dylib 0x000000018008412c objc_exception_throw + 56 2 Alz Meter 0x0000000104f6b99c RCTFormatError + 0 3 Alz Meter 0x0000000104fdea10 -[RCTExceptionsManager reportFatal:stack:exceptionId:extraDataAsJSON:] + 476 4 Alz Meter 0x0000000104fdf234 -[RCTExceptionsManager reportException:] + 1308 5 CoreFoundation 0x0000000180497750 invoking + 144 6 CoreFoundation 0x0000000180494ab4 -[NSInvocation invoke] + 276 7 CoreFoundation 0x0000000180494d4c -[NSInvocation invokeWithTarget:] + 60 8 Alz Meter 0x0000000104f99acc -[RCTModuleMethod invokeWithBridge:module:arguments:] + 388 9 Alz Meter 0x0000000104f9bab0 _ZN8facebook5reactL11invokeInnerEP9RCTBridgeP13RCTModuleDatajRKN5folly7dynamicEiN12_GLOBAL__N_117SchedulingContextE + 452 10 Alz Meter 0x0000000104f9b700 ___ZN8facebook5react15RCTNativeModule6invokeEjON5folly7dynamicEi_block_invoke + 112 11 libdispatch.dylib 0x0000000106f540f0 _dispatch_call_block_and_release + 24 12 libdispatch.dylib 0x0000000106f5593c _dispatch_client_callout + 16 13 libdispatch.dylib 0x0000000106f5dbd8 _dispatch_lane_serial_drain + 916 14 libdispatch.dylib 0x0000000106f5e91c _dispatch_lane_invoke + 420 15 libdispatch.dylib 0x0000000106f6b2f8 _dispatch_root_queue_drain_deferred_wlh + 324 16 libdispatch.dylib 0x0000000106f6a754 _dispatch_workloop_worker_thread + 488 17 libsystem_pthread.dylib 0x0000000106fef924 _pthread_wqthread + 284 18 libsystem_pthread.dylib 0x0000000106fee6e4 start_wqthread + 8 )

Both of these crash reports are kinda munged [1], so it’s hard to be 100% sure, but I suspect that Language Exception from RCTFatal applies here.

Share and Enjoy

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

[1] For info about how to post a crash report, see Posting a Crash Report. For general hints and tips on how to format your post, see Quinn’s Top Ten DevForums Tips.

React Native app crash on splash screen in release mode. In debug everything ok.
 
 
Q