I have noticed my Android app is showing a significant uptick in crashes. I have 49 java.lang.IllegalStateException crashes with my Android app. Here is the specific text from the Google Play console:
java.lang.RuntimeException:
at android.app.ActivityThread.performLaunchActivity (ActivityThread.java:3827)
at android.app.ActivityThread.handleLaunchActivity (ActivityThread.java:4003)
at android.app.servertransaction.LaunchActivityItem.execute (LaunchActivityItem.java:85)
at android.app.servertransaction.TransactionExecutor.executeCallbacks (TransactionExecutor.java:135)
at android.app.servertransaction.TransactionExecutor.execute (TransactionExecutor.java:95)
at android.app.ActivityThread$H.handleMessage (ActivityThread.java:2317)
at android.os.Handler.dispatchMessage (Handler.java:106)
at android.os.Looper.loop (Looper.java:246)
at android.app.ActivityThread.main (ActivityThread.java:8595)
at java.lang.reflect.Method.invoke (Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:602)
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1130)
Caused by: androidx.fragment.app.Fragment$InstantiationException:
at androidx.fragment.app.Fragment.instantiate (Fragment.java:566)
at androidx.fragment.app.FragmentContainer.instantiate (FragmentContainer.java:57)
at androidx.fragment.app.FragmentManager$3.instantiate (FragmentManager.java:390)
at androidx.fragment.app.FragmentStateManager.<init> (FragmentStateManager.java:74)
at androidx.fragment.app.FragmentManager.restoreSaveState (FragmentManager.java:2454)
at androidx.fragment.app.FragmentController.restoreSaveState (FragmentController.java:196)
at androidx.fragment.app.FragmentActivity.onCreate (FragmentActivity.java:287)
at androidx.appcompat.app.AppCompatActivity.onCreate (AppCompatActivity.java:115)
at com.facebook.react.ReactActivity.onCreate (ReactActivity.java:44)
at com.thunkable.live.MainActivity.onCreate (MainActivity.java:17)
at android.app.Activity.performCreate (Activity.java:8207)
at android.app.Activity.performCreate (Activity.java:8191)
at android.app.Instrumentation.callActivityOnCreate (Instrumentation.java:1309)
at android.app.ActivityThread.performLaunchActivity (ActivityThread.java:3800)
Caused by: java.lang.reflect.InvocationTargetException:
at java.lang.reflect.Constructor.newInstance0 (Native Method)
at java.lang.reflect.Constructor.newInstance (Constructor.java:343)
at androidx.fragment.app.Fragment.instantiate (Fragment.java:548)
Caused by: java.lang.IllegalStateException:
at com.swmansion.rnscreens.ScreenFragment.<init> (ScreenFragment.java:42)
I am not an expert in Android by any means, so I have no idea where to zero in on what is causing these crashes. Flipping through the crash data, it appears to crash in both Android 11 (SDK 30) and Android 9 (SDK 28). Has anyone experienced this before? If so, did you figure out what was causing the crashes? I haven’t had anyone reach out to me for support, so I don’t know how big of a concern it is, but seeing the crashes popping up makes me want to investigate it and figure out what is causing the problem.
Edit: After more digging, it is also showing up with Android 7 (SDK 24) and Android 7.1 (SDK 25); albeit less frequently. I assume that’s because a majority of my users are using newer devices.