react-native
react-native copied to clipboard
Android App Crashes on startup
Description
My React Native Android app is crashing as soon as the application is opened, without any changes being made to the application code or dependencies.
Summary of problem
- The app runs fine when creating a local build, however when I sideload the APK generated from my CI build machine, it crashes
- The APK generated by CI on Monday does not crash on startup
- The APK generated by CI on Tuesday crashes on startup
- Generating another APK Monday's commit also crashes on startup
What I've tried
- building a debug APK locally, which does not crash on startup
- getting logs from
logcat
which I've pasted below - Symbolicating the
logcat
using React Native Symbolication
2022-11-18 12:22:38.257 3268-3470 AppPowerController com.lge.systemserver E PowerRM, event=sys.app-start activity=com.app.name/com.app.name.MainActivity package=com.app.name
2022-11-18 12:22:38.258 3268-3470 AppPowerController com.lge.systemserver E PowerRM, ActivityTrans CurApp=com.app.name CurrActivity=com.app.name/com.app.name.MainActivity
2022-11-18 12:22:38.265 3268-3470 AppPowerController com.lge.systemserver E PowerRM, Geo app = com.app.name/com.app.name.MainActivity
2022-11-18 12:22:38.266 3268-3470 AppPowerController com.lge.systemserver E PowerRM, event=sys.activity-start activity=com.app.name/com.app.name.MainActivity package=com.app.name
2022-11-18 12:22:38.328 3268-3470 AppPowerController com.lge.systemserver E PowerRM, event=sys.activity-resume activity=com.app.name/com.app.name.MainActivity package=com.app.name
2022-11-18 12:22:38.507 3268-3470 AppPowerController com.lge.systemserver E PowerRM, event=sys.window-focus activity=null package=com.app.name
2022-11-18 12:22:38.507 3268-3470 AppPowerController com.lge.systemserver E PowerRM, focus changed event packageName =com.app.name
2022-11-18 12:22:38.796 1038-1038 Layer pid-1038 E [Surface(name=AppWindowToken{76e6d8b token=Token{d0a775a ActivityRecord{380267c u0 com.app.name/com.app.name.MainActivity t266}}})/@0x5826ac - animation-leash#0] No local sync point found
2022-11-18 12:22:38.920 20182-20240 AndroidRuntime com.app.name E FATAL EXCEPTION: mqt_js
Process: com.app.name, PID: 20182
java.lang.RuntimeException: Error calling AppRegistry.runApplication
at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
at android.os.Handler.handleCallback(Handler.java:883)
at android.os.Handler.dispatchMessage(Handler.java:100)
at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:27)
at android.os.Looper.loop(Looper.java:214)
at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:226)
at java.lang.Thread.run(Thread.java:919)
Caused by: com.facebook.jni.CppException: Maximum call stack size exceeded.
index.android.bundle:450:382
[email protected]:4:151
index.android.bundle:2021:808
[email protected]:1148:216
Symbolicated logs
2022-11-18 c:\agent\_work\1\s\node_modules\@babel\runtime\helpers\iterableToArrayLimit.js:31:<global>.257 3268-3470 AppPowerController com.lge.systemserver E PowerRM, event=sys.app-start activity=com.app.name/com.app.name.MainActivity package=com.app.name
2022-11-18 c:\agent\_work\1\s\node_modules\@babel\runtime\helpers\iterableToArrayLimit.js:31:<global>.258 3268-3470 AppPowerController com.lge.systemserver E PowerRM, ActivityTrans CurApp=com.app.name CurrActivity=com.app.name/com.app.name.MainActivity
2022-11-18 c:\agent\_work\1\s\node_modules\@babel\runtime\helpers\iterableToArrayLimit.js:31:<global>.265 3268-3470 AppPowerController com.lge.systemserver E PowerRM, Geo app = com.app.name/com.app.name.MainActivity
2022-11-18 c:\agent\_work\1\s\node_modules\@babel\runtime\helpers\iterableToArrayLimit.js:31:<global>.266 3268-3470 AppPowerController com.lge.systemserver E PowerRM, event=sys.activity-start activity=com.app.name/com.app.name.MainActivity package=com.app.name
2022-11-18 c:\agent\_work\1\s\node_modules\@babel\runtime\helpers\iterableToArrayLimit.js:31:<global>.328 3268-3470 AppPowerController com.lge.systemserver E PowerRM, event=sys.activity-resume activity=com.app.name/com.app.name.MainActivity package=com.app.name
2022-11-18 c:\agent\_work\1\s\node_modules\@babel\runtime\helpers\iterableToArrayLimit.js:31:<global>.507 3268-3470 AppPowerController com.lge.systemserver E PowerRM, event=sys.window-focus activity=null package=com.app.name
2022-11-18 c:\agent\_work\1\s\node_modules\@babel\runtime\helpers\iterableToArrayLimit.js:31:<global>.507 3268-3470 AppPowerController com.lge.systemserver E PowerRM, focus changed event packageName =com.app.name
2022-11-18 c:\agent\_work\1\s\node_modules\@babel\runtime\helpers\iterableToArrayLimit.js:31:<global>.796 1038-1038 Layer pid-1038 E [Surface(name=AppWindowToken{76e6d8b token=Token{d0a775a ActivityRecord{380267c u0 com.app.name/com.app.name.MainActivity t266}}})/@0x5826ac - animation-leash#0] No local sync point found
2022-11-18 c:\agent\_work\1\s\node_modules\@babel\runtime\helpers\iterableToArrayLimit.js:31:<global>.920 20182-20240 AndroidRuntime com.app.name E FATAL EXCEPTION: mqt_js
Process: com.app.name, PID: 20182
java.lang.RuntimeException: Error calling AppRegistry.runApplication
at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
at android.os.Handler.handleCallback(Handler.java:883)
at android.os.Handler.dispatchMessage(Handler.java:100)
at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:27)
at android.os.Looper.loop(Looper.java:214)
at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:226)
at java.lang.Thread.run(Thread.java:919)
Caused by: com.facebook.jni.CppException: Maximum call stack size exceeded.
C:\agent\_work\1\s\libs\mobile\core\src\components\App.tsx:38:setJSExceptionHandler$argument_0
c:\agent\_work\1\s\node_modules\@react-native\polyfills\error-guard.js:45:ErrorUtils.reportError
C:\agent\_work\1\s\node_modules\react-native-exception-handler\index.js:18:console.error
C:\agent\_work\1\s\libs\mobile\logger\src\logger.ts:6:error
Version
0.67.4
Output of npx react-native info
System:
OS: macOS 12.6
CPU: (10) arm64 Apple M1 Pro
Memory: 125.08 MB / 32.00 GB
Shell: 5.8.1 - /bin/zsh
Binaries:
Node: 16.13.0 - ~/.nvm/versions/node/v16.13.0/bin/node
Yarn: 1.22.19 - ~/.nvm/versions/node/v16.13.0/bin/yarn
npm: 6.14.15 - ~/Coding/Spatial-2.0/node_modules/.bin/npm
Watchman: 2022.10.03.00 - /opt/homebrew/bin/watchman
Managers:
CocoaPods: 1.11.3 - /opt/homebrew/bin/pod
SDKs:
iOS SDK:
Platforms: DriverKit 22.1, iOS 16.1, macOS 13.0, tvOS 16.1, watchOS 9.1
Android SDK:
API Levels: 28, 29, 30, 31, 32
Build Tools: 30.0.2, 30.0.3, 31.0.0, 32.0.0, 32.1.0, 33.0.0, 33.0.0
System Images: android-31 | Google APIs ARM 64 v8a, android-32 | Google APIs ARM 64 v8a
Android NDK: Not Found
IDEs:
Android Studio: 2021.3 AI-213.7172.25.2113.9014738
Xcode: 14.1/14B47b - /usr/bin/xcodebuild
Languages:
Java: 11.0.13 - /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/javac
npmPackages:
@react-native-community/cli: 7.0.1 => 7.0.1
react: 17.0.2 => 17.0.2
react-native: 0.67.4 => 0.67.4
react-native-macos: Not Found
npmGlobalPackages:
*react-native*: Not Found
Steps to reproduce
I'm not sure how to reproduce it
Snack, code example, screenshot, or link to a repository
unavailable
I too am having the same issue.
I recently upgraded my gradle from 6.9 to 7.3.3, also upgraded the compileSdkVersion & targetSdkVersion from 30 to 31, and upgraded Java files from OpenJ 1.8 to Java 11.
Ever since then the apks build locally debug and release are working perfectly, but when I upload the .aab to the play console and after it gets updated on play store, the app doesn't open after installing.
I don't understand how I could debug this!😭
Please do let me know if I could do. Thank you.
I too am having the same issue.
I upgraded the compileSdk & targetSDK from 30 to 31 then the apk working perfectly. But when i upload to the play console and after it gets updated on play store, the app doesn't open after installing on Android 12 devices.
Below is the Android 12 device bug report.
Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified
Please do let me know if I could do. Thank you.
To me, doing the solution proposed in this same thread, resolved the issue:
https://stackoverflow.com/a/70974248/4176026
I too am having the same issue.
I upgraded the compileSdk & targetSDK from 30 to 31 then the apk working perfectly. But when i upload to the play console and after it gets updated on play store, the app doesn't open after installing on Android 12 devices.
Below is the Android 12 device bug report.
Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified
Please do let me know if I could do. Thank you.
This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.
This issue was closed because it has been stalled for 7 days with no activity.
any solution