# Android App Crashes (java.lang.IllegalStateException)

**URL:** <https://community.thunkable.com/t/android-app-crashes-java-lang-illegalstateexception/1565084>\
**Category:** Questions about Thunkable X\
**Created:** [October 16, 2021, 5:16pm UTC](https://community.thunkable.com/t/android-app-crashes-java-lang-illegalstateexception/1565084 "2021-10-16T17:16:29Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ronnie](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ronnie/32/121539_2.png) [@ronnie](https://community.thunkable.com/u/ronnie)\
**Post date:** [October 16, 2021, 5:16pm UTC](https://community.thunkable.com/t/android-app-crashes-java-lang-illegalstateexception/1565084/1 "2021-10-16T17:16:30Z")

</div>

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:

```auto
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.

---

<div class="post-metadata">

**Author:** ![namitnagar](https://avatars.discourse-cdn.com/v4/letter/n/a183cd/32.png) [@namitnagar](https://community.thunkable.com/u/namitnagar)\
**Post date:** [October 16, 2021, 6:04pm UTC](https://community.thunkable.com/t/android-app-crashes-java-lang-illegalstateexception/1565084/2 "2021-10-16T18:04:47Z")

</div>

App made on thunkable?

---

<div class="post-metadata">

**Author:** ![ronnie](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ronnie/32/121539_2.png) [@ronnie](https://community.thunkable.com/u/ronnie)\
**Post date:** [October 16, 2021, 6:08pm UTC](https://community.thunkable.com/t/android-app-crashes-java-lang-illegalstateexception/1565084/3 "2021-10-16T18:08:14Z")

</div>

Yes.

---

<div class="post-metadata">

**Author:** ![ronnie](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ronnie/32/121539_2.png) [@ronnie](https://community.thunkable.com/u/ronnie)\
**Post date:** [October 16, 2021, 6:16pm UTC](https://community.thunkable.com/t/android-app-crashes-java-lang-illegalstateexception/1565084/4 "2021-10-16T18:16:19Z")

</div>

I loaded the APK into Android Studio and let it run for a while. I had no issues on two different emulated devices. I don’t know if this is something I need to be concerned with or not, but I only had a handful of crashes before I released my v4 which was with the new AAB requirement. I have had a total of 79 crashes in the past 60 days. I would not have known about them unless someone contacted me with issues, but I was checking in the Play console and noticed all of these crashes.

---

<div class="post-metadata">

**Author:** ![ioannis](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ioannis/32/146956_2.png) [@ioannis](https://community.thunkable.com/u/ioannis)\
**Post date:** [November 8, 2024, 1:14pm UTC](https://community.thunkable.com/t/android-app-crashes-java-lang-illegalstateexception/1565084/5 "2024-11-08T13:14:50Z")

</div>


