We randomly got this crash from users with android 6 and 7 (Unity 5.3.4, 5.3.7, 5.5.1, 5.5.2)
Fatal Exception: java.lang.RuntimeException
Unable to start activity ComponentInfo{MY_UNITY_ACTIVITY_EXTEND}: android.app.Fragment$InstantiationException: Unable to instantiate fragment com.unity3d.player.n$1: make sure class name exists, is public, and has an empty constructor that is public
which takes about 2% of total users
Here is my manifest:
<activity android:name="MY_UNITY_ACTIVITY_EXTEND" android:label="@string/app_name" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen" android:launchMode="singleTop">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<meta-data android:name="android.app.lib_name" android:value="unity" />
<meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="true" />
</activity>
Dose anyone has the similar issues? Please help. Thanks!
Raw Text
Fatal Exception: java.lang.RuntimeException: Unable to start activity ComponentInfo{MY_UNITY_ACTIVITY_EXTEND}: android.app.Fragment$InstantiationException: Unable to instantiate fragment com.unity3d.player.n$1: make sure class name exists, is public, and has an empty constructor that is public
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2464)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2524)
at android.app.ActivityThread.access$900(ActivityThread.java:154)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1391)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:224)
at android.app.ActivityThread.main(ActivityThread.java:5526)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Caused by android.app.Fragment$InstantiationException: Unable to instantiate fragment com.unity3d.player.n$1: make sure class name exists, is public, and has an empty constructor that is public
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:923)
at com.unity3d.player.UnityPlayerActivity.onCreate(Unknown Source)
at MY_UNITY_ACTIVITY_EXTEND.onCreate(SWUnityExternalJavaPlugin.java:134)
at android.app.Activity.performCreate(Activity.java:6285)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1108)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2417)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2524)
at android.app.ActivityThread.access$900(ActivityThread.java:154)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1391)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:224)
at android.app.ActivityThread.main(ActivityThread.java:5526)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Caused by java.lang.IllegalAccessException: java.lang.Class<com.unity3d.player.n$1> is not accessible from java.lang.Class<android.app.Fragment>
at java.lang.Class.newInstance(Class.java)
at android.app.Fragment.instantiate(Fragment.java:613)
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:923)
at com.unity3d.player.UnityPlayerActivity.onCreate(Unknown Source)
at MY_UNITY_ACTIVITY_EXTEND.onCreate(SWUnityExternalJavaPlugin.java:134)
at android.app.Activity.performCreate(Activity.java:6285)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1108)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2417)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2524)
at android.app.ActivityThread.access$900(ActivityThread.java:154)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1391)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:224)
at android.app.ActivityThread.main(ActivityThread.java:5526)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)