java.lang.RuntimeException

If you like a tip written by other Samebug users, mark is as helpful! Marks help our algorithm provide you better solutions and also help other users.
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.

  • This is a regression on 3.2.3.GA. The issue does not happen on 3.2.2.GA. To reproduce: 1. Turn on the developer option "do not keep activities". 2. Run KS. 3. Click any test, eg "Slider". 4. Click the BACK button. Expected behavior: the app is closed without crash. Actual behavior: the app crashes. Here is the crash log: {code} E/TiApplication( 1172): (main) [13,29380] Sending event: exception on thread: main msg:java.lang.RuntimeException: Unable to start activity ComponentInfo{com.appcelerator.kitchensink/org.appcelerator.titanium.TiActivity}: android.app.Fragment$InstantiationException: Unable to instantiate fragment ti.modules.titanium.ui.widget.tabgroup.TiUIActionBarTab$TabFragment: make sure class name exists, is public, and has an empty constructor that is public; Titanium 3.2.3,2014/04/22 10:17,b958a70 E/TiApplication( 1172): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.appcelerator.kitchensink/org.appcelerator.titanium.TiActivity}: android.app.Fragment$InstantiationException: Unable to instantiate fragment ti.modules.titanium.ui.widget.tabgroup.TiUIActionBarTab$TabFragment: make sure class name exists, is public, and has an empty constructor that is public E/TiApplication( 1172): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1956) E/TiApplication( 1172): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981) E/TiApplication( 1172): at android.app.ActivityThread.access$600(ActivityThread.java:123) E/TiApplication( 1172): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147) E/TiApplication( 1172): at android.os.Handler.dispatchMessage(Handler.java:99) E/TiApplication( 1172): at android.os.Looper.loop(Looper.java:137) E/TiApplication( 1172): at android.app.ActivityThread.main(ActivityThread.java:4424) E/TiApplication( 1172): at java.lang.reflect.Method.invokeNative(Native Method) E/TiApplication( 1172): at java.lang.reflect.Method.invoke(Method.java:511) E/TiApplication( 1172): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784) E/TiApplication( 1172): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551) E/TiApplication( 1172): at dalvik.system.NativeStart.main(Native Method) E/TiApplication( 1172): Caused by: android.app.Fragment$InstantiationException: Unable to instantiate fragment ti.modules.titanium.ui.widget.tabgroup.TiUIActionBarTab$TabFragment: make sure class name exists, is public, and has an empty constructor that is public E/TiApplication( 1172): at android.app.Fragment.instantiate(Fragment.java:585) E/TiApplication( 1172): at android.app.FragmentState.instantiate(Fragment.java:96) E/TiApplication( 1172): at android.app.FragmentManagerImpl.restoreAllState(FragmentManager.java:1682) E/TiApplication( 1172): at android.app.Activity.onCreate(Activity.java:861) E/TiApplication( 1172): at android.support.v4.app.FragmentActivity.onCreate(FragmentActivity.java:204) E/TiApplication( 1172): at org.appcelerator.titanium.TiBaseActivity.onCreate(TiBaseActivity.java:520) E/TiApplication( 1172): at org.appcelerator.titanium.TiActivity.onCreate(TiActivity.java:18) E/TiApplication( 1172): at android.app.Activity.performCreate(Activity.java:4465) E/TiApplication( 1172): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049) E/TiApplication( 1172): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1920) E/TiApplication( 1172): ... 11 more E/TiApplication( 1172): Caused by: java.lang.InstantiationException: can't instantiate class ti.modules.titanium.ui.widget.tabgroup.TiUIActionBarTab$TabFragment; no empty constructor E/TiApplication( 1172): at java.lang.Class.newInstanceImpl(Native Method) E/TiApplication( 1172): at java.lang.Class.newInstance(Class.java:1319) E/TiApplication( 1172): at android.app.Fragment.instantiate(Fragment.java:574) E/TiApplication( 1172): ... 20 more {code}
    via by Ping Wang,
  • When a window is closed and returns to a tabgroup, the app crashes. "Unfortunately, YourApp has stopped." {color:red} [ERROR] : TiApplication: Caused by: android.app.Fragment$InstantiationException: Unable to instantiate fragment ti.modules.titanium.ui.widget.tabgroup.TiUIActionBarTab$TabFragment: make sure class name exists, is public, and has an empty constructor that is public [ERROR] : TiApplication: Caused by: java.lang.InstantiationException: can't instantiate class ti.modules.titanium.ui.widget.tabgroup.TiUIActionBarTab$TabFragment; no empty constructor {color} To simulate the error run the code below + Developer options -> Enable "Don't keep activities" (Or open plenty of apps in the background) {code} var tabWin1 = Ti.UI.createWindow({title : 'TW1'}); var tabWin2 = Ti.UI.createWindow({title : 'TW2'}); var tab1 = Ti.UI.createTab({window : tabWin1,title : 'Tab 1'}); var tab2 = Ti.UI.createTab({window : tabWin2,title : 'Tab 2'}); var tabGroup = Ti.UI.createTabGroup({tabs : [tab1,tab2]}); var win2 = Ti.UI.createWindow({title: 'Window 2'}); var openWindowButton = Ti.UI.createButton({widht:Ti.UI.SIZE,height:Ti.UI.SIZE,title:'Open window2'}); tabWin1.add(openWindowButton); var closeWindowButton = Ti.UI.createButton({widht:Ti.UI.SIZE,height:Ti.UI.SIZE,title:'Close window2'}); win2.add(closeWindowButton); openWindowButton.addEventListener('click',function(e){win2.open();}); closeWindowButton.addEventListener('click',function(e){win2.close();}); tabGroup.open(); {code} __FULL_ERROR___ {color:red} [WARN] : dalvikvm: threadid=1: thread exiting with uncaught exception (group=0xa4d48b20) [ERROR] : TiApplication: (main) [7830,7830] Sending event: exception on thread: main msg:java.lang.RuntimeException: Unable to start activity ComponentInfo{test.geny.com/org.appcelerator.titanium.TiActivity}: android.app.Fragment$InstantiationException: Unable to instantiate fragment ti.modules.titanium.ui.widget.tabgroup.TiUIActionBarTab$TabFragment: make sure class name exists, is public, and has an empty constructor that is public; Titanium 3.2.3,2014/04/22 10:17,b958a70 [ERROR] : TiApplication: java.lang.RuntimeException: Unable to start activity ComponentInfo{test.geny.com/org.appcelerator.titanium.TiActivity}: android.app.Fragment$InstantiationException: Unable to instantiate fragment ti.modules.titanium.ui.widget.tabgroup.TiUIActionBarTab$TabFragment: make sure class name exists, is public, and has an empty constructor that is public [ERROR] : TiApplication: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2195) [ERROR] : TiApplication: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245) [ERROR] : TiApplication: at android.app.ActivityThread.access$800(ActivityThread.java:135) [ERROR] : TiApplication: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196) [ERROR] : TiApplication: at android.os.Handler.dispatchMessage(Handler.java:102) [ERROR] : TiApplication: at android.os.Looper.loop(Looper.java:136) [ERROR] : TiApplication: at android.app.ActivityThread.main(ActivityThread.java:5017) [ERROR] : TiApplication: at java.lang.reflect.Method.invokeNative(Native Method) [ERROR] : TiApplication: at java.lang.reflect.Method.invoke(Method.java:515) [ERROR] : TiApplication: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779) [ERROR] : TiApplication: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595) [ERROR] : TiApplication: at dalvik.system.NativeStart.main(Native Method) [ERROR] : TiApplication: Caused by: android.app.Fragment$InstantiationException: Unable to instantiate fragment ti.modules.titanium.ui.widget.tabgroup.TiUIActionBarTab$TabFragment: make sure class name exists, is public, and has an empty constructor that is public [ERROR] : TiApplication: at android.app.Fragment.instantiate(Fragment.java:601) [ERROR] : TiApplication: at android.app.FragmentState.instantiate(Fragment.java:98) [ERROR] : TiApplication: at android.app.FragmentManagerImpl.restoreAllState(FragmentManager.java:1759) [ERROR] : TiApplication: at android.app.Activity.onCreate(Activity.java:899) [ERROR] : TiApplication: at android.support.v4.app.FragmentActivity.onCreate(FragmentActivity.java:204) [ERROR] : TiApplication: at org.appcelerator.titanium.TiBaseActivity.onCreate(TiBaseActivity.java:520) [ERROR] : TiApplication: at org.appcelerator.titanium.TiActivity.onCreate(TiActivity.java:18) [ERROR] : TiApplication: at android.app.Activity.performCreate(Activity.java:5231) [ERROR] : TiApplication: at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087) [ERROR] : TiApplication: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2159) [ERROR] : TiApplication: ... 11 more [ERROR] : TiApplication: Caused by: java.lang.InstantiationException: can't instantiate class ti.modules.titanium.ui.widget.tabgroup.TiUIActionBarTab$TabFragment; no empty constructor [ERROR] : TiApplication: at java.lang.Class.newInstanceImpl(Native Method) [ERROR] : TiApplication: at java.lang.Class.newInstance(Class.java:1208) [ERROR] : TiApplication: at android.app.Fragment.instantiate(Fragment.java:590) [ERROR] : TiApplication: ... 20 more [INFO] : Process: Sending signal. PID: 1446 SIG: 9 {color}
    via by Bar Bruy,
    • java.lang.RuntimeException: Unable to start activity ComponentInfo{com.appcelerator.kitchensink/org.appcelerator.titanium.TiActivity}: android.app.Fragment$InstantiationException: Unable to instantiate fragment ti.modules.titanium.ui.widget.tabgroup.TiUIActionBarTab$TabFragment: make sure class name exists, is public, and has an empty constructor that is public at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1956) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981) at android.app.ActivityThread.access$600(ActivityThread.java:123) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:137) at android.app.ActivityThread.main(ActivityThread.java:4424) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:511) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551) at dalvik.system.NativeStart.main(Native Method) Caused by: android.app.Fragment$InstantiationException: Unable to instantiate fragment ti.modules.titanium.ui.widget.tabgroup.TiUIActionBarTab$TabFragment: make sure class name exists, is public, and has an empty constructor that is public at android.app.Fragment.instantiate(Fragment.java:585) at android.app.FragmentState.instantiate(Fragment.java:96) at android.app.FragmentManagerImpl.restoreAllState(FragmentManager.java:1682) at android.app.Activity.onCreate(Activity.java:861) at android.support.v4.app.FragmentActivity.onCreate(FragmentActivity.java:204) at org.appcelerator.titanium.TiBaseActivity.onCreate(TiBaseActivity.java:520) at org.appcelerator.titanium.TiActivity.onCreate(TiActivity.java:18) at android.app.Activity.performCreate(Activity.java:4465) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1920) ... 11 more Caused by: java.lang.InstantiationException: can't instantiate class ti.modules.titanium.ui.widget.tabgroup.TiUIActionBarTab$TabFragment; no empty constructor at java.lang.Class.newInstanceImpl(Native Method) at java.lang.Class.newInstance(Class.java:1319) at android.app.Fragment.instantiate(Fragment.java:574) ... 20 more

    Users with the same issue

    brunosatriani
    40 times, last one,
    asvid
    40 times, last one,
    Macapon
    3 times, last one,
    Unknown visitor1 times, last one,
    Unknown User
    178 times, last one,
    39 more bugmates