java.lang.NullPointerException

Appcelerator JIRA | Justin Toth | 5 years ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    After upgrading from 1.8.1 to the latest CI build (2.0.0.v20120215111634), I am now receiving an error related to closing a window. If there is a TableView added to the window and the window has the navBarHidden property set (either to true or false), when closing that window it will cause a NullPointerException error. {code} D/AndroidRuntime(21347): Shutting down VM W/dalvikvm(21347): threadid=1: thread exiting with uncaught exception (group=0x401b7760) E/TiApplication(21347): (main) [1475,203564] Sending event: exception on thread: main msg:java.lang.NullPointerException; Titanium 2.0.0,2012/02/15 11:16,f358132 E/TiApplication(21347): java.lang.NullPointerException E/TiApplication(21347): at ti.modules.titanium.ui.widget.tableview.TiTableView.onLayout(TiTableView.java:496) E/TiApplication(21347): at android.view.View.layout(View.java:9601) E/TiApplication(21347): at android.view.ViewGroup.layout(ViewGroup.java:3879) E/TiApplication(21347): at org.appcelerator.titanium.view.TiCompositeLayout.onLayout(TiCompositeLayout.java:382) E/TiApplication(21347): at android.view.View.layout(View.java:9601) E/TiApplication(21347): at android.view.ViewGroup.layout(ViewGroup.java:3879) E/TiApplication(21347): at android.widget.FrameLayout.onLayout(FrameLayout.java:400) E/TiApplication(21347): at android.view.View.layout(View.java:9601) E/TiApplication(21347): at android.view.ViewGroup.layout(ViewGroup.java:3879) E/TiApplication(21347): at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1542) E/TiApplication(21347): at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1403) E/TiApplication(21347): at android.widget.LinearLayout.onLayout(LinearLayout.java:1314) E/TiApplication(21347): at android.view.View.layout(View.java:9601) E/TiApplication(21347): at android.view.ViewGroup.layout(ViewGroup.java:3879) E/TiApplication(21347): at android.widget.FrameLayout.onLayout(FrameLayout.java:400) E/TiApplication(21347): at android.view.View.layout(View.java:9601) E/TiApplication(21347): at android.view.ViewGroup.layout(ViewGroup.java:3879) E/TiApplication(21347): at android.view.ViewRoot.performTraversals(ViewRoot.java:1286) E/TiApplication(21347): at android.view.ViewRoot.handleMessage(ViewRoot.java:2063) E/TiApplication(21347): at android.os.Handler.dispatchMessage(Handler.java:99) E/TiApplication(21347): at android.os.Looper.loop(Looper.java:132) E/TiApplication(21347): at android.app.ActivityThread.main(ActivityThread.java:4126) E/TiApplication(21347): at java.lang.reflect.Method.invokeNative(Native Method) E/TiApplication(21347): at java.lang.reflect.Method.invoke(Method.java:491) E/TiApplication(21347): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:844) E/TiApplication(21347): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:602) {code} Here is code to reproduce the issue: {code} //create window 1. Ti.API.info("opening window 1"); var win = Ti.UI.createWindow({ backgroundColor: "#fff", navBarHidden: true, softInputMode: Ti.UI.Android.SOFT_INPUT_ADJUST_RESIZE, exitOnClose: true }); win.open(); var label = Ti.UI.createLabel({ text: "Window 1", width: "auto", height: "auto", top: 10 }); win.add(label); var openWindow2Button = Ti.UI.createButton({ title: "Open Window 2", height: "auto", width: "auto", bottom: 10 }); openWindow2Button.addEventListener("click", function() { //create window 2. Ti.API.info("opening window 2"); var win2 = Ti.UI.createWindow({ backgroundColor: "#fff", navBarHidden: true,//this causes crash on window 2 close!! softInputMode: Ti.UI.Android.SOFT_INPUT_ADJUST_RESIZE, exitOnClose: false }); win2.open(); var label2 = Ti.UI.createLabel({ text: "Window 2", width: "auto", height: "auto", top: 10 }); win2.add(label2); var closeWindow2Button = Ti.UI.createButton({ title: "Close Window 2", height: "auto", width: "auto", bottom: 10 }); closeWindow2Button.addEventListener("click", function() { Ti.API.info("closing window 2"); win2.close(); }); win2.add(closeWindow2Button); var table = Ti.UI.createTableView({ top: 60, bottom: 60, left: 0, right: 0, data: [] }); win2.add(table); }); win.add(openWindow2Button); {code}

    Appcelerator JIRA | 5 years ago | Justin Toth
    java.lang.NullPointerException
  2. 0

    After upgrading from 1.8.1 to the latest CI build (2.0.0.v20120215111634), I am now receiving an error related to closing a window. If there is a TableView added to the window and the window has the navBarHidden property set (either to true or false), when closing that window it will cause a NullPointerException error. {code} D/AndroidRuntime(21347): Shutting down VM W/dalvikvm(21347): threadid=1: thread exiting with uncaught exception (group=0x401b7760) E/TiApplication(21347): (main) [1475,203564] Sending event: exception on thread: main msg:java.lang.NullPointerException; Titanium 2.0.0,2012/02/15 11:16,f358132 E/TiApplication(21347): java.lang.NullPointerException E/TiApplication(21347): at ti.modules.titanium.ui.widget.tableview.TiTableView.onLayout(TiTableView.java:496) E/TiApplication(21347): at android.view.View.layout(View.java:9601) E/TiApplication(21347): at android.view.ViewGroup.layout(ViewGroup.java:3879) E/TiApplication(21347): at org.appcelerator.titanium.view.TiCompositeLayout.onLayout(TiCompositeLayout.java:382) E/TiApplication(21347): at android.view.View.layout(View.java:9601) E/TiApplication(21347): at android.view.ViewGroup.layout(ViewGroup.java:3879) E/TiApplication(21347): at android.widget.FrameLayout.onLayout(FrameLayout.java:400) E/TiApplication(21347): at android.view.View.layout(View.java:9601) E/TiApplication(21347): at android.view.ViewGroup.layout(ViewGroup.java:3879) E/TiApplication(21347): at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1542) E/TiApplication(21347): at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1403) E/TiApplication(21347): at android.widget.LinearLayout.onLayout(LinearLayout.java:1314) E/TiApplication(21347): at android.view.View.layout(View.java:9601) E/TiApplication(21347): at android.view.ViewGroup.layout(ViewGroup.java:3879) E/TiApplication(21347): at android.widget.FrameLayout.onLayout(FrameLayout.java:400) E/TiApplication(21347): at android.view.View.layout(View.java:9601) E/TiApplication(21347): at android.view.ViewGroup.layout(ViewGroup.java:3879) E/TiApplication(21347): at android.view.ViewRoot.performTraversals(ViewRoot.java:1286) E/TiApplication(21347): at android.view.ViewRoot.handleMessage(ViewRoot.java:2063) E/TiApplication(21347): at android.os.Handler.dispatchMessage(Handler.java:99) E/TiApplication(21347): at android.os.Looper.loop(Looper.java:132) E/TiApplication(21347): at android.app.ActivityThread.main(ActivityThread.java:4126) E/TiApplication(21347): at java.lang.reflect.Method.invokeNative(Native Method) E/TiApplication(21347): at java.lang.reflect.Method.invoke(Method.java:491) E/TiApplication(21347): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:844) E/TiApplication(21347): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:602) {code} Here is code to reproduce the issue: {code} //create window 1. Ti.API.info("opening window 1"); var win = Ti.UI.createWindow({ backgroundColor: "#fff", navBarHidden: true, softInputMode: Ti.UI.Android.SOFT_INPUT_ADJUST_RESIZE, exitOnClose: true }); win.open(); var label = Ti.UI.createLabel({ text: "Window 1", width: "auto", height: "auto", top: 10 }); win.add(label); var openWindow2Button = Ti.UI.createButton({ title: "Open Window 2", height: "auto", width: "auto", bottom: 10 }); openWindow2Button.addEventListener("click", function() { //create window 2. Ti.API.info("opening window 2"); var win2 = Ti.UI.createWindow({ backgroundColor: "#fff", navBarHidden: true,//this causes crash on window 2 close!! softInputMode: Ti.UI.Android.SOFT_INPUT_ADJUST_RESIZE, exitOnClose: false }); win2.open(); var label2 = Ti.UI.createLabel({ text: "Window 2", width: "auto", height: "auto", top: 10 }); win2.add(label2); var closeWindow2Button = Ti.UI.createButton({ title: "Close Window 2", height: "auto", width: "auto", bottom: 10 }); closeWindow2Button.addEventListener("click", function() { Ti.API.info("closing window 2"); win2.close(); }); win2.add(closeWindow2Button); var table = Ti.UI.createTableView({ top: 60, bottom: 60, left: 0, right: 0, data: [] }); win2.add(table); }); win.add(openWindow2Button); {code}

    Appcelerator JIRA | 5 years ago | Justin Toth
    java.lang.NullPointerException
  3. 0

    Attempt to invoke virtual method on a null object reference - Android - java

    developer-works.com | 1 year ago
    java.lang.NullPointerException: Attempt to invoke virtual method 'java.util.ArrayList foto.studio.SQLiteDataSource.getAllImageItems()' on a null object reference at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2693) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2758) at android.app.ActivityThread.access$900(ActivityThread.java:177) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1448) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:145) at android.app.ActivityThread.main(ActivityThread.java:5942) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1400)
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Attempt to invoke virtual method on a null object reference

    xluat.com | 1 year ago
    java.lang.NullPointerException: Attempt to invoke virtual method 'java.util.ArrayList foto.studio.SQLiteDataSource.getAllImageItems()' on a null object reference at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2693) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2758) at android.app.ActivityThread.access$900(ActivityThread.java:177) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1448) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:145) at android.app.ActivityThread.main(ActivityThread.java:5942) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1400)
  6. 0

    Attempt to invoke virtual method on a null object reference

    pr8x.com | 1 year ago
    java.lang.NullPointerException: Attempt to invoke virtual method 'java.util.ArrayList foto.studio.SQLiteDataSource.getAllImageItems()' on a null object reference at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2693) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2758) at android.app.ActivityThread.access$900(ActivityThread.java:177) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1448) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:145) at android.app.ActivityThread.main(ActivityThread.java:5942) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1400)

    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

      No message provided

      at ti.modules.titanium.ui.widget.tableview.TiTableView.onLayout()
    2. ti.modules.titanium
      TiTableView.onLayout
      1. ti.modules.titanium.ui.widget.tableview.TiTableView.onLayout(TiTableView.java:496)
      1 frame
    3. Android Platform
      ViewGroup.layout
      1. android.view.View.layout(View.java:9601)
      2. android.view.ViewGroup.layout(ViewGroup.java:3879)
      2 frames
    4. org.appcelerator.titanium
      TiCompositeLayout.onLayout
      1. org.appcelerator.titanium.view.TiCompositeLayout.onLayout(TiCompositeLayout.java:382)
      1 frame
    5. Android Platform
      ActivityThread.main
      1. android.view.View.layout(View.java:9601)
      2. android.view.ViewGroup.layout(ViewGroup.java:3879)
      3. android.widget.FrameLayout.onLayout(FrameLayout.java:400)
      4. android.view.View.layout(View.java:9601)
      5. android.view.ViewGroup.layout(ViewGroup.java:3879)
      6. android.widget.LinearLayout.setChildFrame(LinearLayout.java:1542)
      7. android.widget.LinearLayout.layoutVertical(LinearLayout.java:1403)
      8. android.widget.LinearLayout.onLayout(LinearLayout.java:1314)
      9. android.view.View.layout(View.java:9601)
      10. android.view.ViewGroup.layout(ViewGroup.java:3879)
      11. android.widget.FrameLayout.onLayout(FrameLayout.java:400)
      12. android.view.View.layout(View.java:9601)
      13. android.view.ViewGroup.layout(ViewGroup.java:3879)
      14. android.view.ViewRoot.performTraversals(ViewRoot.java:1286)
      15. android.view.ViewRoot.handleMessage(ViewRoot.java:2063)
      16. android.os.Handler.dispatchMessage(Handler.java:99)
      17. android.os.Looper.loop(Looper.java:132)
      18. android.app.ActivityThread.main(ActivityThread.java:4126)
      18 frames
    6. Java RT
      Method.invoke
      1. java.lang.reflect.Method.invokeNative(Native Method)
      2. java.lang.reflect.Method.invoke(Method.java:491)
      2 frames
    7. Android
      ZygoteInit.main
      1. com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:844)
      2. com.android.internal.os.ZygoteInit.main(ZygoteInit.java:602)
      2 frames