java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Object java.util.ArrayList.set(int, java.lang.Object)' on a null object reference

Appcelerator JIRA | Terry Morgan | 10 months ago
  1. 0

    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: {code} // 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); {code} Stack trace: {panel} [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) {panel}

    Appcelerator JIRA | 10 months ago | Terry Morgan
    java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Object java.util.ArrayList.set(int, java.lang.Object)' on a null object reference
  2. 0

    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: {code} // 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); {code} Stack trace: {panel} [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) {panel}

    Appcelerator JIRA | 10 months ago | Terry Morgan
    java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Object java.util.ArrayList.set(int, java.lang.Object)' on a null object reference
  3. 0

    App crashes with NPE from fragment manager makeInactive method

    Stack Overflow | 3 weeks ago | Ruturaj Patil
    java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Object java.util.ArrayList.set(int, java.lang.Object)' on a null object reference
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Odd logcat error when switching to new fragment

    Stack Overflow | 2 years ago | Alexander Kohler
    java.lang.NullPointerException: Attempt to read from field 'boolean android.support.v4.app.BackStackRecord.mAddToBackStack' on a null object reference
  6. 0

    ForPDA - 4PDA

    4pda.ru | 11 months ago
    java.lang.NullPointerException: Attempt to write to field 'int android.support.v4.app.Fragment.mNextAnim' on a null object reference

    16 unregistered visitors
    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.NullPointerException

      Attempt to invoke virtual method 'java.lang.Object java.util.ArrayList.set(int, java.lang.Object)' on a null object reference

      at android.support.v4.app.FragmentManagerImpl.makeInactive()
    2. Android Support v4
      FragmentManagerImpl$1.run
      1. android.support.v4.app.FragmentManagerImpl.makeInactive(FragmentManager.java:1261)
      2. android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1168)
      3. android.support.v4.app.FragmentManagerImpl.removeFragment(FragmentManager.java:1304)
      4. android.support.v4.app.BackStackRecord.run(BackStackRecord.java:708)
      5. android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1572)
      6. android.support.v4.app.FragmentManagerImpl$1.run(FragmentManager.java:493)
      6 frames
    3. Android Platform
      ActivityThread.main
      1. android.os.Handler.handleCallback(Handler.java:739)
      2. android.os.Handler.dispatchMessage(Handler.java:95)
      3. android.os.Looper.loop(Looper.java:145)
      4. android.app.ActivityThread.main(ActivityThread.java:5832)
      4 frames
    4. Java RT
      Method.invoke
      1. java.lang.reflect.Method.invoke(Native Method)
      2. java.lang.reflect.Method.invoke(Method.java:372)
      2 frames
    5. Android
      ZygoteInit.main
      1. com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1399)
      2. com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1194)
      2 frames