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().

GitHub | naivehhr | 6 months ago
tip
Click on the to mark the solution that helps you, Samebug will learn from it.
As a community member, you’ll be rewarded for you help.
  1. 0

    [Android] App occasionally crash on startup

    GitHub | 6 months ago | naivehhr
    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().

    Root Cause Analysis

    1. 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().

      at com.facebook.react.bridge.ReactContext.getJSModule()
    2. com.facebook.react
      ReactContext.getJSModule
      1. com.facebook.react.bridge.ReactContext.getJSModule(ReactContext.java:99)
      1 frame
    3. com.jucaiapp.modules
      AppStateModule.onActivityStarted
      1. com.jucaiapp.modules.AppStateModule.tellAppState(AppStateModule.java:72)
      2. com.jucaiapp.modules.AppStateModule.onActivityStarted(AppStateModule.java:58)
      2 frames
    4. Android Platform
      ActivityThread.main
      1. android.app.Application.dispatchActivityStarted(Application.java:173)
      2. android.app.Activity.onStart(Activity.java:1076)
      3. android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1178)
      4. android.app.Activity.performStart(Activity.java:5216)
      5. android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2073)
      6. android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2125)
      7. android.app.ActivityThread.access$600(ActivityThread.java:140)
      8. android.app.ActivityThread$H.handleMessage(ActivityThread.java:1227)
      9. android.os.Handler.dispatchMessage(Handler.java:99)
      10. android.os.Looper.loop(Looper.java:137)
      11. android.app.ActivityThread.main(ActivityThread.java:4898)
      11 frames
    5. Java RT
      Method.invoke
      1. java.lang.reflect.Method.invokeNative(Native Method)
      2. java.lang.reflect.Method.invoke(Method.java:511)
      2 frames
    6. Android
      ZygoteInit.main
      1. com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1008)
      2. com.android.internal.os.ZygoteInit.main(ZygoteInit.java:775)
      2 frames
    7. Android Platform
      NativeStart.main
      1. dalvik.system.NativeStart.main(Native Method)
      1 frame