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

Closing a Ti.UI.TabGroup that contains a ti.map view crashes the app on Android

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: Release 7.0.1
    • Component/s: Android
    • Labels:
    • Environment:

      Android 5.0, 5.1 & 6
      Samsung S5
      Nexus 5X
      Ti SDK 5.1.0.GA + 5.1.2.GA

      Description

      Attempting to close a Ti.UI.TabGroup when it contains a ti.map map view in one of it's tabs causes the app crash.

      Test case:

      // this sets the background color of the master UIView (when there are no windows/tab groups on it)
      Titanium.UI.setBackgroundColor('#000');
       
      // create tab group
      var tabGroup = Titanium.UI.createTabGroup();
       
      var win1 = Titanium.UI.createWindow({
          title:'Tab 1',
          backgroundColor:'#fff'
      });
      var tab1 = Titanium.UI.createTab({
          icon:'KS_nav_views.png',
          title:'Tab 1',
          window:win1
      });
       
      var Map = require('ti.map');
      var mapview = Map.createView();
       
      win1.add(mapview);
      tabGroup.addTab(tab1);
      tabGroup.open();
       
      // Close the tabGroup after 8 seconds
      setTimeout(function(){
          console.log("Closing tabGroup");
          tabGroup.close();
      }, 8000);
      

      Stack trace:

      [ERROR] TiApplication: (main) [8315,8315] Sending event: exception on thread: main msg:java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Object java.util.ArrayList.set(int, java.lang.Object)' on a null object reference; Titanium 5.1.2,2015/12/16 19:00,ca822b2
      [ERROR] TiApplication: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Object java.util.ArrayList.set(int, java.lang.Object)' on a null object reference
      [ERROR] TiApplication: at android.support.v4.app.FragmentManagerImpl.makeInactive(FragmentManager.java:1261)
      [ERROR] TiApplication: at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1168)
      [ERROR] TiApplication: at android.support.v4.app.FragmentManagerImpl.removeFragment(FragmentManager.java:1304)
      [ERROR] TiApplication: at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:708)
      [ERROR] TiApplication: at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1572)
      [ERROR] TiApplication: at android.support.v4.app.FragmentManagerImpl$1.run(FragmentManager.java:493)
      [ERROR] TiApplication: at android.os.Handler.handleCallback(Handler.java:739)
      [ERROR] TiApplication: at android.os.Handler.dispatchMessage(Handler.java:95)
      [ERROR] TiApplication: at android.os.Looper.loop(Looper.java:145)
      [ERROR] TiApplication: at android.app.ActivityThread.main(ActivityThread.java:5832)
      [ERROR] TiApplication: at java.lang.reflect.Method.invoke(Native Method)
      [ERROR] TiApplication: at java.lang.reflect.Method.invoke(Method.java:372)
      [ERROR] TiApplication: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1399)
      [ERROR] TiApplication: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1194)
      [ERROR] AndroidRuntime: FATAL EXCEPTION: main
      [ERROR] AndroidRuntime: Process: com.thevirtualforge.tabtest2, PID: 6616
      [ERROR] AndroidRuntime: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Object java.util.ArrayList.set(int, java.lang.Object)' on a null object reference
      [ERROR] AndroidRuntime: at android.support.v4.app.FragmentManagerImpl.makeInactive(FragmentManager.java:1261)
      [ERROR] AndroidRuntime: at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1168)
      [ERROR] AndroidRuntime: at android.support.v4.app.FragmentManagerImpl.removeFragment(FragmentManager.java:1304)
      [ERROR] AndroidRuntime: at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:708)
      [ERROR] AndroidRuntime: at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1572)
      [ERROR] AndroidRuntime: at android.support.v4.app.FragmentManagerImpl$1.run(FragmentManager.java:493)
      [ERROR] AndroidRuntime: at android.os.Handler.handleCallback(Handler.java:739)
      [ERROR] AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:95)
      [ERROR] AndroidRuntime: at android.os.Looper.loop(Looper.java:145)
      [ERROR] AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:5832)
      [ERROR] AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
      [ERROR] AndroidRuntime: at java.lang.reflect.Method.invoke(Method.java:372)
      [ERROR] AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1399)
      [ERROR] AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1194)

        Attachments

          Activity

            People

            • Assignee:
              ybanev Yordan Banev
              Reporter:
              shodan_uk Terry Morgan
              Reviewer:
              Gary Mathews
              Tester:
              Lokesh Choudhary
            • Watchers:
              12 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

                • It looks like Backbone Issue Sync is not enabled for your project.

                  Git Source Code