android.support.v4.app.Fragment$InstantiationException: Unable to instantiate fragment com.wenming.weiswift.ui.login.activity.MainActivity$6: make sure class name exists, is public, and has an empty constructor that is public

tip

This happens when you try to instantiate a class that can't be instantiated, either because the class object is abstract, an interface, an array class, a primitive type, void, or because the class has no nullary constructor.

You have a different solution? A short tip here would help you and many other users who saw this issue last week.

  • Crash: no empty constructor
    via GitHub by khk624
    ,
    • android.support.v4.app.Fragment$InstantiationException: Unable to instantiate fragment com.wenming.weiswift.ui.login.activity.MainActivity$6: make sure class name exists, is public, and has an empty constructor that is public at android.support.v4.app.Fragment.instantiate(Fragment.java:431) at android.support.v4.app.FragmentState.instantiate(Fragment.java:102) at android.support.v4.app.FragmentManagerImpl.restoreAllState(FragmentManager.java:1952) at android.support.v4.app.FragmentController.restoreAllState(FragmentController.java:144) at android.support.v4.app.FragmentActivity.onCreate(FragmentActivity.java:307) at com.wenming.weiswift.ui.login.activity.MainActivity.onCreate(MainActivity.java:60) at android.app.Activity.performCreate(Activity.java:5356) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2163) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2258) at android.app.ActivityThread.access$800(ActivityThread.java:147) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1211) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:136) at android.app.ActivityThread.main(ActivityThread.java:5135) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:515) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:795) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:611) at dalvik.system.NativeStart.main(Native Method) Caused by: java.lang.InstantiationException: can't instantiate class com.wenming.weiswift.ui.login.activity.MainActivity$6; no empty constructor at java.lang.Class.newInstanceImpl(Native Method) at java.lang.Class.newInstance(Class.java:1208) at android.support.v4.app.Fragment.instantiate(Fragment.java:420) ... 19 more

    Users with the same issue

    filpgame
    filpgame8 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    Unknown User
    Unknown User178 times, last one,
    Andreas Häber
    Andreas Häber2 times, last one,
    39 more bugmates