question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Android] App occasionally crash on startup

See original GitHub issue

Release version of the APP is installed to the SamsungGalaxy Note II.When I repeated attempts to open APP, occasionally crash.

Thanks


Error Message:

E/AndroidRuntime(31955): FATAL EXCEPTION: main
E/AndroidRuntime(31955): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.naive.Ju244/com.naive.MainActivity}: java.lang.RuntimeException: Tried to access a JS module before the React instance was fully set up. Calls to ReactContext#getJSModule should be protected by ReactContext#hasActiveCatalystInstance().
E/AndroidRuntime(31955):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2100)
E/AndroidRuntime(31955):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2125)
E/AndroidRuntime(31955):    at android.app.ActivityThread.access$600(ActivityThread.java:140)
E/AndroidRuntime(31955):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1227)
E/AndroidRuntime(31955):    at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime(31955):    at android.os.Looper.loop(Looper.java:137)
E/AndroidRuntime(31955):    at android.app.ActivityThread.main(ActivityThread.java:4898)
E/AndroidRuntime(31955):    at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime(31955):    at java.lang.reflect.Method.invoke(Method.java:511)
E/AndroidRuntime(31955):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1008)
E/AndroidRuntime(31955):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:775)
E/AndroidRuntime(31955):    at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime(31955): Caused by: java.lang.RuntimeException: Tried to access a JS module before the React instance was fully set up. Calls to ReactContext#getJSModule should be protected by ReactContext#hasActiveCatalystInstance().
E/AndroidRuntime(31955):    at com.facebook.react.bridge.ReactContext.getJSModule(ReactContext.java:99)
E/AndroidRuntime(31955):    at com.jucaiapp.modules.AppStateModule.tellAppState(AppStateModule.java:72)
E/AndroidRuntime(31955):    at com.jucaiapp.modules.AppStateModule.onActivityStarted(AppStateModule.java:58)
E/AndroidRuntime(31955):    at android.app.Application.dispatchActivityStarted(Application.java:173)
E/AndroidRuntime(31955):    at android.app.Activity.onStart(Activity.java:1076)
E/AndroidRuntime(31955):    at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1178)
E/AndroidRuntime(31955):    at android.app.Activity.performStart(Activity.java:5216)
E/AndroidRuntime(31955):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2073)
E/AndroidRuntime(31955):    ... 11 more
E/android.os.Debug(2276): !@Dumpstate > dumpstate -k -t -z -d -o /data/log/dumpstate_app_error
E/Launcher(2778): Error finding setting, default accessibility to not found: accessibility_enabled
E/Watchdog(2276): !@Sync 1838
E/MtpService(31941): In MTPAPP onReceive:android.intent.action.BATTERY_CHANGED
  • “react-native”: “^0.29.0”
  • “android:4.1.2”

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
lavystordcommented, Sep 4, 2016

Add android:name=".MainApplication"in the <application />section of AndroidManifest.xml. It should now look like,

<application
+   android:name=".MainApplication"
    android:allowBackup="true"
    android:label="@string/app_name"
    android:icon="@mipmap/ic_launcher"
    android:theme="@style/AppTheme">
0reactions
facebook-github-botcommented, Nov 14, 2016

@charpeni tells me to close this issue. If you think it should still be opened let us know why.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why do my apps keep crashing on Android, How to fix it
1. Force stop the app · 2. Restart the device · 3 . Clear app data · 4. Reinstall the app · 5....
Read more >
11 Quick Ways to Fix Apps Keep Crashing on Android - iMobie
Go to “Settings” > Apps > Find the app that keeps crashing. · Go to Settings > “Apps” or “Application manager” > Choose...
Read more >
Why Do My Apps Keep Crashing on Android? - Avast
1. The “Force stop” method · 2. Restart your Android device · 3. Keep your phone updated · 4. Clear your cached data...
Read more >
8 Ways to Fix Android Apps Crashing - MakeUseOf
1. Check the Internet Connection · 2. Restart the Crashing App · 3. Restart Your Device · 4. Check the App for Updates...
Read more >
Crashes - Android Developers
An Android app crashes whenever there's an unexpected exit caused by an unhandled exception or signal. An app that is written using Java...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found