Hi to all,
Lately I’m checking the issues that our game has on several android devices and I’m checking all the data reported by Android Vitals in the Google Play Console.
I found that a lot of crashes were due to a java.lang.RuntimeException and Caused by: android.app.Fragment$InstantiationException:
this is a sample of what the data looks like.
java.lang.RuntimeException:
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2440)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2500)
at android.app.ActivityThread.access$900(ActivityThread.java:163)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1362)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5585)
at java.lang.reflect.Method.invoke(Native Method:0)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:730)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:620)
Caused by: android.app.Fragment$InstantiationException:
at android.app.Fragment.instantiate(Fragment.java:628)
at android.app.FragmentState.instantiate(Fragment.java:106)
at android.app.FragmentManagerImpl.restoreAllState(FragmentManager.java:1858)
at android.app.FragmentController.restoreAllState(FragmentController.java:122)
at android.app.Activity.onCreate(Activity.java:919)
at com.unity3d.player.UnityPlayerActivity.onCreate(Unknown Source:0)
at com.unity3d.player.UnityPlayerNativeActivity.onCreate(Unknown Source:0)
at android.app.Activity.performCreate(Activity.java:6279)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1108)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2393)
The version of Unity3D is 5.6.0f3 and all the crashes (so far) are on Android 6.0 devices.
Supported OpenGL Version reported by Internals goes from OpenGL ES 2.0 to ES 3.1.
Unfortunately:
- I do not experience crashes on the devices I use for testing so I haven’t a logcat or can’t replicate the bug.
- I’m not expert of Unity3D internals so I do not know what I may do wrong. Seems it’s a crash during the startup phase. Seems it is ‘fragment’ creation but what can I check to pinpoint the problem? I don’t see any common factor in the 100+ crash reports (all RuntimeException in Fragment$InstantiationException).
What can I do to solve a bug like this?