IOS (React-native) app crashes in test flight while working fine in emulator

Hi,
I am stuck on this for a few days now. Please help.

My ReactNative app crashes in TestFlight but seems to work fine in the simulator

In the device log of the simulator, I see this but it does not crash the app
Code Block
May 22 19:53:07 *** UserEventAgent[31908]: assertion failed: 20E241 18E182: com.apple.cts + 21381 [CDC23A9A-67DC-30DB-B211-8782B0F90693]: 0x7d1e
May 22 19:53:07 *** syslogd[31920]: ASL Sender Statistics






Last Crash Trace on Device
Code Block
Incident Identifier: 64EB34E3-B5C9-464C-9B78-5583CD5127BA
Hardware Model: iPhone9,2
Process: ThrivApp [5825]
Path: /private/var/containers/Bundle/Application/E864769F-B995-444A-BFDE-F4B49218D131/ThrivApp.app/ThrivApp
Identifier: com.thriv.thriv
Version: 10199 (10023)
AppStoreTools: 12E262
AppVariant: 1:iPhone9,2:14
Beta: YES
Code Type: ARM-64 (Native)
Role: Foreground
Parent Process: launchd [1]
Coalition: com.thriv.thriv [1269]
Date/Time: 2021-05-22 19:56:40.7041 -0700
Launch Time: 2021-05-22 19:56:39.2456 -0700
OS Version: iPhone OS 14.4.2 (18D70)
Release Type: User
Baseband Version: 8.40.01
Report Version: 104
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Triggered by Thread: 1
Last Exception Backtrace:
0 CoreFoundation 0x18699a9d8 __exceptionPreprocess + 216 (NSException.m:199)
1 libobjc.A.dylib 0x19ad1db54 objc_exception_throw + 56 (objc-exception.mm:565)
2 ThrivApp 0x102810be0 RCTFatal + 668 (RCTAssert.m:146)
3 ThrivApp 0x10288fdc8 -[RCTExceptionsManager reportFatal:stack:exceptionId:suppressRedBox:] + 600 (RCTExceptionsManager.mm:89)
4 ThrivApp 0x10289078c -[RCTExceptionsManager reportException:] + 1532 (RCTExceptionsManager.mm:164)
5 CoreFoundation 0x18699f130 __invoking___ + 144
6 CoreFoundation 0x1868821d0 -[NSInvocation invoke] + 300 (NSForwarding.m:3389)
7 CoreFoundation 0x186882730 -[NSInvocation invokeWithTarget:] + 76 (NSForwarding.m:3495)
8 ThrivApp 0x102842868 -[RCTModuleMethod invokeWithBridge:module:arguments:] + 460 (RCTModuleMethod.mm:584)
9 ThrivApp 0x102844c98 facebook::react::invokeInner(RCTBridge*, RCTModuleData*, unsigned int, folly::dynamic const&, int, (anonymous namespace)::SchedulingContext) + 540 (RCTNativeModule.mm:181)
10 ThrivApp 0x1028448c4 operator() + 56 (RCTNativeModule.mm:103)
11 ThrivApp 0x1028448c4 invocation function for block in facebook::react::RCTNativeModule::invoke(unsigned int, folly::dynamic&&, int) + 100 (RCTNativeModule.mm:95)
12 libdispatch.dylib 0x1865d2298 _dispatch_call_block_and_release + 24 (init.c:1454)
13 libdispatch.dylib 0x1865d3280 _dispatch_client_callout + 16 (object.m:559)
14 libdispatch.dylib 0x18657bdcc _dispatch_lane_serial_drain$VARIANT$mp + 612 (inline_internal.h:2548)
15 libdispatch.dylib 0x18657c8a8 _dispatch_lane_invoke$VARIANT$mp + 424 (queue.c:3862)
16 libdispatch.dylib 0x186586338 _dispatch_workloop_worker_thread + 712 (queue.c:6601)
17 libsystem_pthread.dylib 0x1cf1bd5a4 _pthread_wqthread + 272 (pthread.c:2210)
18 libsystem_pthread.dylib 0x1cf1c0874 start_wqthread + 8



Answered by ChandanMaruthi in 675711022
Esimko where are you , can you kindly take a look
Accepted Answer
Esimko where are you , can you kindly take a look
Quick update, I tried this on a brand new app I created with react-native init and I see it happen with it as well
v12.22.1
Code Block "dependencies": {
"@react-native-async-storage/async-storage": "^1.13.2",
"@react-native-community/masked-view": "0.1.10",
"@react-native-community/netinfo": "5.9.6",
"@react-native-community/slider": "3.0.3",
"@react-native-community/toolbar-android": "0.1.0-rc.2",
"@react-navigation/bottom-tabs": "^5.3.3",
"@react-navigation/compat": "^5.1.14",
"@react-navigation/drawer": "^5.6.3",
"@react-navigation/material-bottom-tabs": "^5.1.14",
"@react-navigation/material-top-tabs": "^5.2.16",
"@react-navigation/native": "^5.2.3",
"@react-navigation/stack": "^5.2.18",
"@sentry/react-native": "^2.4.3",
"aws-sdk": "^2.912.0",
"babel-preset-expo": "^8.3.0",
"create-react-native-app": "^3.5.1",
"d3-scale": "^3.2.1",
"date-fns": "^2.12.0",
"instabug-reactnative": "^10.4.0",
"mobx": "^6.3.2",
"mobx-react": "^7.2.0",
"moment": "^2.27.0",
"node-pre-***": "^0.17.0",
"npm": "^7.14.0",
"react": "17.0.1",
"react-dom": "16.13.1",
"react-native": "^0.64.1",
"react-native-android-immersive-mode": "^1.3.0",
"react-native-chart-kit": "^6.11.0",
"react-native-document-picker": "^5.0.4",
"react-native-elements": "^3.4.1",
"react-native-file-viewer": "^2.1.4",
"react-native-flip-card": "^3.5.6",
"react-native-gesture-handler": "^1.10.3",
"react-native-image-pan-zoom": "^2.1.12",
"react-native-image-picker": "^3.8.0",
"react-native-linear-gradient": "^2.5.6",
"react-native-mime-types": "^2.3.0",
"react-native-mixpanel": "^1.2.5",
"react-native-navigation-bar-color": "^2.0.1",
"react-native-onesignal": "^4.1.0",
"react-native-pager-view": "^5.1.9",
"react-native-permissions": "^3.0.0",
"react-native-push-notification": "^7.3.1",
"react-native-reanimated": "^2.1.0",
"react-native-safe-area-context": "^3.1.9",
"react-native-screens": "^3.3.0",
"react-native-search-header": "^0.3.5",
"react-native-share": "^6.1.0",
"react-native-snap-carousel": "^3.9.1",
"react-native-splash-screen": "^3.2.0",
"react-native-svg": "^12.1.1",
"react-native-svg-charts": "^5.4.0",
"react-native-swipe-gestures": "1.0.5",
"react-native-tab-view": "^3.0.1",
"react-native-vector-icons": "^8.1.0",
"react-native-video": "^5.0.2",
"react-native-web": "^0.16.1",
"react-refresh": "^0.9.0",
"rn-bottom-drawer": "1.4.3",
"rn-fetch-blob": "^0.12.0",
"rollbar-react-native": "^0.9.2",
"save": "^2.4.0",
"save-dev": "0.0.1-security",
"turtle-cli": "^0.21.6"


Package.json of the brand new app thats showing this assertion error as well
Code Block {
"name": "NewTestApp",
"version": "0.0.1",
"private": true,
"scripts": {
"android": "react-native run-android",
"ios": "react-native run-ios",
"start": "react-native start",
"test": "jest",
"lint": "eslint ."
},
"dependencies": {
"react": "17.0.1",
"react-native": "0.64.1"
},
"devDependencies": {
"@babel/core": "7.14.3",
"@babel/runtime": "^7.14.0",
"@react-native-community/eslint-config": "2.0.0",
"babel-jest": "26.6.3",
"eslint": "7.14.0",
"jest": "26.6.3",
"metro-react-native-babel-preset": "0.64.0",
"react-test-renderer": "17.0.1"
},
"jest": {
"preset": "react-native"
}
}


Hi, I have the same problem. Did you find any solution for it?

Hi there! having the same issue? Any tip?

One more person hoping there's an answer for this. I've seen a few other posts in the support forums here with what looks like the same crash log, but the answer always stops short at "It's probably a javascript bug in your code being caught".

For us React Native devs, I wish there was some more detailed info we could get to at least point us in a better direction to begin looking for a bug.

Same is here...

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

Last Exception Backtrace: 0 CoreFoundation 0x180aaf05c __exceptionPreprocess + 220 (NSException.m:200) 1 libobjc.A.dylib 0x198fc9f54 objc_exception_throw + 60 (objc-exception.mm:565) 2 conanco 0x1021931b4 -[EXUpdatesAppController start] + 780 (EXUpdatesAppController.m:0) 3 conanco 0x102193468 -[EXUpdatesAppController startAndShowLaunchScreen:] + 692 (EXUpdatesAppController.m:174) 4 conanco 0x102194398 -[EXUpdatesAppDelegate application:didFinishLaunchingWithOptions:] + 488 (EXUpdatesAppDelegate.m:64) 5 conanco 0x1021afff0 0x102164000 + 311280 6 conanco 0x1021694dc -[AppDelegate application:didFinishLaunchingWithOptions:] + 672 (AppDelegate.m:58) 7 UIKitCore 0x1831e9f8c -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 356 (UIApplication.m:2292) 8 UIKitCore 0x1833d24f0 -[UIApplication _callInitializationDelegatesWithActions:forCanvas:payload:fromOriginatingProcess:] + 3524 (UIApplication.m:2704) 9 UIKitCore 0x1833bae5c -[UIApplication _runWithMainScene:transitionContext:completion:] + 1208 (UIApplication.m:4437) 10 UIKitCore 0x183217f34 -[_UISceneLifecycleMultiplexer completeApplicationLaunchWithFBSScene:transitionContext:] + 152 (_UISceneLifecycleMultiplexer.m:452) 11 UIKitCore 0x18306f240 _UIScenePerformActionsWithLifecycleActionMask + 104 (_UISceneLifecycleState.m:109) 12 UIKitCore 0x18319b958 __101-[_UISceneLifecycleMultiplexer _evalTransitionToSettings:fromSettings:forceExit:withTransitionStore:]_block_invoke + 224 (_UISceneLifecycleMultiplexer.m:565)

Same issue here,

In sentry it's:

OutOfMemory The OS most likely terminated your app because it overused RAM.

In Sentry documentation, there are a known issue related to this overused RAM.

When I look at the issue on XCode I can see that it happened on the code block:

#else
  (void)(callId);
#endif
  @autoreleasepool {
   invokeInner(weakBridge, weakModuleData, methodId, std::move(params), callId, isSyncModule ? Sync : Async);
  }
 };

However, it's too generic, it's not possible to define the issue only looking at it. It happens randomly in the app.

I am getting this same stack trace. I have narrowed the crash down to this import "react-native-snap-carousel": "3.9.1". When commenting out my import for that library, the app doesnt crash. Looking for a solution still.

IOS (React-native) app crashes in test flight while working fine in emulator
 
 
Q