Android App Crashes on startup

This issue has been created since 2022-11-18.

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

Elvin-Skaria wrote this answer on 2022-11-18

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.

manikanta-sai wrote this answer on 2022-11-22

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.

More Details About Repo
Owner Name facebook
Repo Name react-native
Full Name facebook/react-native
Language JavaScript
Created Date 2015-01-09
Updated Date 2022-12-10
Star Count 106395
Watcher Count 3660
Fork Count 22685
Issue Count 2288

YOU MAY BE INTERESTED

Issue Title Created Date Comment Count Updated Date
Exception while running an example 4 2019-10-10 2022-11-18
Feature: Update SnackBar attributes/properties 5 2022-08-08 2022-12-04
feat(authentication): expose `providerData` property 0 2022-07-26 2022-11-30
bug: Capacitor-Firebase plugins are not compatible with AngularFire 4 2022-07-31 2022-10-27
Grid zoom doesn't match node zoom 1 2019-08-28 2022-11-21
compute graph example 3 2020-11-02 2022-04-10
Version 10.0.19041.1023 full supported but not working 0 2021-11-25 2022-10-05
Jackd errors and give no sound 1 2021-10-31 2022-11-17
Is there a way to cancel the keyboard shortcut for h1 only? 1 2021-09-30 2022-12-09
crash on mouse click 0 2022-10-04 2022-10-12
Minor issue in the ordering of expected and actual arguments in error message 0 2021-09-21 2022-10-29
[BUG] Installation Of VST3 Fails If previous VST3 File Exists 1 2022-11-03 2022-11-05
OpenlauncherLib est il compatible avec les comptes Minecraft crack ? 1 2019-07-09 2022-10-30
[AppSpec] Add AppSpec validation / semantic analysis 3 2022-01-14 2022-07-27
Expose `safe-slots-to-import-optimistically` cli param 0 2022-01-14 2022-10-23
BUG:All configured authentication methods failed 1 2022-07-07 2022-10-07
transitive issue between FlxColor and UInt 0 2021-09-16 2022-11-06
After greetings , this issue is intended to request the improvement of the project documentation in the following aspects : 2 2021-08-30 2022-11-28
Indicate uncommitted changes at the widget and canvas levels 3 2022-06-14 2022-10-08
Include FormValidation into webpack - Plugins errors 2 2022-01-20 2022-11-11
Exception: SchemaProblem{errors=['onOperation' tried to use an undeclared directive 'deprecated', 'onFragment' tried to use an undeclared directive 'deprecated', 'onField' tried to use an undeclared directive 'deprecated']} 3 2021-12-08 2022-10-09
Rendering Errors when using element with v-for instead of template with slot 4 2022-01-07 2022-12-02
Not sure if a bug or best practice? EventContent function issue 3 2021-06-24 2022-11-28
`NullPointerException` on the `RowResource` 2 2022-07-21 2022-09-02
イントネーション欄で「無声化した音」のイントネーションを変更出来ないようになっているが変更出来ない理由がわかるように表示して欲しい 0 2021-09-20 2022-01-14
Integrate client tracing with backend `OpenTelemetry` tracing passthrough 2 2022-07-22 2022-11-08
Alert when pod in Pending state in cloud 1 2022-02-08 2022-09-26
sub-repo permissions should work with repositoryPathPattern 1 2022-02-08 2022-08-28
[Suggestions] Add a gpl binaries of opencv-python include ffmpeg x264, x265 9 2021-04-23 2022-09-20
Build from source doesn't generate same .so files 26 2022-10-28 2022-12-05
Move Collection not being created on Scan 9 2021-06-03 2022-12-02
Test that we're not causing duplicate crates 5 2022-03-02 2022-10-22
CI: Update job to OpenShift 4.11 0 2022-04-19 2022-09-11
🐛 Bug Report: admin ui test fail 10 2021-11-10 2022-12-07
Enum members starting "try" don't appear in completion list when "try" is typed as a prefix 1 2022-04-26 2022-10-24
EnsembleAnalysis problem when integer values are used for initial conditions 2 2021-03-09 2022-11-29
Add SQLDialect.SQLITE_3_39 1 2022-06-27 2022-11-08
Difference with gopkg.in/yaml.v2 when value is passed instead of a reference 28 2019-12-03 2022-11-28
Can't find “make:model” option 1 2022-10-29 2022-12-01
Work Permit/delivery note 7 2022-02-07 2022-11-19
[BUG] no failover with aclfile and different sentinel users/passwords 2 2021-11-11 2022-07-27
Set identity expiration/timeout 7 2019-01-28 2022-11-12
Attempting to flash nRF52 after double-fault fails 4 2022-07-10 2022-11-04
The tooltip stays in screen after clicking the fabitem 3 2020-05-18 2022-11-27
Keep * as glob pattern 5 2020-04-05 2022-11-18
async by default 41 2021-12-13 2022-01-13
[Feature][release] More intelligent release process and change less files by human 2 2022-04-13 2022-11-14
compile fails with {:error, :no_beam_info} with elixir 1.10 13 2020-04-10 2022-11-07
Scraper reads same url for all requests 3 2022-10-14 2022-11-05
Upgrade to System.CommandLine 2.0.0 beta4 0 2022-07-05 2022-10-20