Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-17016

Android: Closing Window and returning to TabGroup crashes app with "Unable to instantiate fragment"

    Details

    • Sprint:
      2014 Sprint 12 SDK, 2014 Sprint 13 SDK

      Description

      When a window is closed and returns to a tabgroup, the app crashes.
      "Unfortunately, YourApp has stopped."

      [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

      To simulate the error run the code below

      + Developer options -> Enable "Don't keep activities" (Or open plenty of apps in the background)

      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();
      

      _FULL_ERROR__

      [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

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                sunila Sunila
                Reporter:
                bar b Bar Bruy
                Reviewer:
                Hieu Pham
                Tester:
                Lokesh Choudhary
              • Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

                  • Titanium SDK/CLI <> Titanium Mobile
                    Synced with:
                    TIMOB-18744
                    Sync status:
                    ERROR
                    Last received:
                    Last sent:

                    Git Source Code