java.lang.NullPointerException

Appcelerator JIRA | Ygor Lemos | 2 months ago
  1. 0

    Based on http://developer.appcelerator.com/question/180283/always-a-crash-race-condition-with-android-back-button Summary - If you press back fast enough during app open Titanium apps will crash. Looks like the android back event that causes the app to tear down can cause the root UI element to be null when adding the first Window of the project to it. This happens on device for the bare minimum installs of Titanium project with or without Alloy. Easier to repro on Alloy as it takes a bit longer for the app to launch. TI 3.5.0.GA Mac Yosemite Samsung Galaxy S5 and Note3 (and others) 1. ti create a new android project 2. cd into root of project 3. alloy create 4. ti build -p android -T device --device-id <device> 5. Important step: On the device (not simulator), launch app AND IMMEDIATELY start pressing back button. ** Keep closing and reopening app as fast as you can if you don't see it repro the first time in step 5 **** This happens when a Window is the default/first item created in the Activity as well Expected - App closes Actual - App crashes and closes Stack - 01-27 13:32:08.269: E/AndroidRuntime(20104): FATAL EXCEPTION: main 01-27 13:32:08.269: E/AndroidRuntime(20104): Process: com.test, PID: 20104 01-27 13:32:08.269: E/AndroidRuntime(20104): java.lang.NullPointerException 01-27 13:32:08.269: E/AndroidRuntime(20104): at android.content.ComponentName.<init>(ComponentName.java:77) 01-27 13:32:08.269: E/AndroidRuntime(20104): at android.content.Intent.<init>(Intent.java:4445) 01-27 13:32:08.269: E/AndroidRuntime(20104): at ti.modules.titanium.ui.WindowProxy.handleOpen(WindowProxy.java:127) 01-27 13:32:08.269: E/AndroidRuntime(20104): at org.appcelerator.titanium.proxy.TiWindowProxy.handleMessage(TiWindowProxy.java:88) 01-27 13:32:08.269: E/AndroidRuntime(20104): at ti.modules.titanium.ui.WindowProxy.handleMessage(WindowProxy.java:415) 01-27 13:32:08.269: E/AndroidRuntime(20104): at android.os.Handler.dispatchMessage(Handler.java:98) 01-27 13:32:08.269: E/AndroidRuntime(20104): at android.os.Looper.loop(Looper.java:146) 01-27 13:32:08.269: E/AndroidRuntime(20104): at android.app.ActivityThread.main(ActivityThread.java:5678) 01-27 13:32:08.269: E/AndroidRuntime(20104): at java.lang.reflect.Method.invokeNative(Native Method) 01-27 13:32:08.269: E/AndroidRuntime(20104): at java.lang.reflect.Method.invoke(Method.java:515) 01-27 13:32:08.269: E/AndroidRuntime(20104): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1291) 01-27 13:32:08.269: E/AndroidRuntime(20104): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1107) 01-27 13:32:08.269: E/AndroidRuntime(20104): at dalvik.system.NativeStart.main(Native Method)

    Appcelerator JIRA | 2 years ago | josh rose
    java.lang.NullPointerException
  2. 0

    Based on http://developer.appcelerator.com/question/180283/always-a-crash-race-condition-with-android-back-button Summary - If you press back fast enough during app open Titanium apps will crash. Looks like the android back event that causes the app to tear down can cause the root UI element to be null when adding the first Window of the project to it. This happens on device for the bare minimum installs of Titanium project with or without Alloy. Easier to repro on Alloy as it takes a bit longer for the app to launch. TI 3.5.0.GA Mac Yosemite Samsung Galaxy S5 and Note3 (and others) 1. ti create a new android project 2. cd into root of project 3. alloy create 4. ti build -p android -T device --device-id <device> 5. Important step: On the device (not simulator), launch app AND IMMEDIATELY start pressing back button. ** Keep closing and reopening app as fast as you can if you don't see it repro the first time in step 5 **** This happens when a Window is the default/first item created in the Activity as well Expected - App closes Actual - App crashes and closes Stack - 01-27 13:32:08.269: E/AndroidRuntime(20104): FATAL EXCEPTION: main 01-27 13:32:08.269: E/AndroidRuntime(20104): Process: com.test, PID: 20104 01-27 13:32:08.269: E/AndroidRuntime(20104): java.lang.NullPointerException 01-27 13:32:08.269: E/AndroidRuntime(20104): at android.content.ComponentName.<init>(ComponentName.java:77) 01-27 13:32:08.269: E/AndroidRuntime(20104): at android.content.Intent.<init>(Intent.java:4445) 01-27 13:32:08.269: E/AndroidRuntime(20104): at ti.modules.titanium.ui.WindowProxy.handleOpen(WindowProxy.java:127) 01-27 13:32:08.269: E/AndroidRuntime(20104): at org.appcelerator.titanium.proxy.TiWindowProxy.handleMessage(TiWindowProxy.java:88) 01-27 13:32:08.269: E/AndroidRuntime(20104): at ti.modules.titanium.ui.WindowProxy.handleMessage(WindowProxy.java:415) 01-27 13:32:08.269: E/AndroidRuntime(20104): at android.os.Handler.dispatchMessage(Handler.java:98) 01-27 13:32:08.269: E/AndroidRuntime(20104): at android.os.Looper.loop(Looper.java:146) 01-27 13:32:08.269: E/AndroidRuntime(20104): at android.app.ActivityThread.main(ActivityThread.java:5678) 01-27 13:32:08.269: E/AndroidRuntime(20104): at java.lang.reflect.Method.invokeNative(Native Method) 01-27 13:32:08.269: E/AndroidRuntime(20104): at java.lang.reflect.Method.invoke(Method.java:515) 01-27 13:32:08.269: E/AndroidRuntime(20104): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1291) 01-27 13:32:08.269: E/AndroidRuntime(20104): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1107) 01-27 13:32:08.269: E/AndroidRuntime(20104): at dalvik.system.NativeStart.main(Native Method)

    Appcelerator JIRA | 2 years ago | josh rose
    java.lang.NullPointerException
  3. 0

    Based on http://developer.appcelerator.com/question/180283/always-a-crash-race-condition-with-android-back-button Summary - If you press back fast enough during app open Titanium apps will crash. Looks like the android back event that causes the app to tear down can cause the root UI element to be null when adding the first Window of the project to it. This happens on device for the bare minimum installs of Titanium project with or without Alloy. Easier to repro on Alloy as it takes a bit longer for the app to launch. TI 3.5.0.GA Mac Yosemite Samsung Galaxy S5 and Note3 (and others) 1. ti create a new android project 2. cd into root of project 3. alloy create 4. ti build -p android -T device --device-id <device> 5. Important step: On the device (not simulator), launch app AND IMMEDIATELY start pressing back button. ** Keep closing and reopening app as fast as you can if you don't see it repro the first time in step 5 **** This happens when a Window is the default/first item created in the Activity as well Expected - App closes Actual - App crashes and closes Stack - 01-27 13:32:08.269: E/AndroidRuntime(20104): FATAL EXCEPTION: main 01-27 13:32:08.269: E/AndroidRuntime(20104): Process: com.test, PID: 20104 01-27 13:32:08.269: E/AndroidRuntime(20104): java.lang.NullPointerException 01-27 13:32:08.269: E/AndroidRuntime(20104): at android.content.ComponentName.<init>(ComponentName.java:77) 01-27 13:32:08.269: E/AndroidRuntime(20104): at android.content.Intent.<init>(Intent.java:4445) 01-27 13:32:08.269: E/AndroidRuntime(20104): at ti.modules.titanium.ui.WindowProxy.handleOpen(WindowProxy.java:127) 01-27 13:32:08.269: E/AndroidRuntime(20104): at org.appcelerator.titanium.proxy.TiWindowProxy.handleMessage(TiWindowProxy.java:88) 01-27 13:32:08.269: E/AndroidRuntime(20104): at ti.modules.titanium.ui.WindowProxy.handleMessage(WindowProxy.java:415) 01-27 13:32:08.269: E/AndroidRuntime(20104): at android.os.Handler.dispatchMessage(Handler.java:98) 01-27 13:32:08.269: E/AndroidRuntime(20104): at android.os.Looper.loop(Looper.java:146) 01-27 13:32:08.269: E/AndroidRuntime(20104): at android.app.ActivityThread.main(ActivityThread.java:5678) 01-27 13:32:08.269: E/AndroidRuntime(20104): at java.lang.reflect.Method.invokeNative(Native Method) 01-27 13:32:08.269: E/AndroidRuntime(20104): at java.lang.reflect.Method.invoke(Method.java:515) 01-27 13:32:08.269: E/AndroidRuntime(20104): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1291) 01-27 13:32:08.269: E/AndroidRuntime(20104): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1107) 01-27 13:32:08.269: E/AndroidRuntime(20104): at dalvik.system.NativeStart.main(Native Method)

    Appcelerator JIRA | 2 months ago | Ygor Lemos
    java.lang.NullPointerException
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  1. balajivaishnav 2 times, last 9 months ago
12 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

    No message provided

    at android.content.ComponentName.<init>()
  2. Android Platform
    Intent.<init>
    1. android.content.ComponentName.<init>(ComponentName.java:77)
    2. android.content.Intent.<init>(Intent.java:4445)
    2 frames
  3. ti.modules.titanium
    WindowProxy.handleOpen
    1. ti.modules.titanium.ui.WindowProxy.handleOpen(WindowProxy.java:127)
    1 frame
  4. org.appcelerator.titanium
    TiWindowProxy.handleMessage
    1. org.appcelerator.titanium.proxy.TiWindowProxy.handleMessage(TiWindowProxy.java:88)
    1 frame
  5. ti.modules.titanium
    WindowProxy.handleMessage
    1. ti.modules.titanium.ui.WindowProxy.handleMessage(WindowProxy.java:415)
    1 frame
  6. Android Platform
    ActivityThread.main
    1. android.os.Handler.dispatchMessage(Handler.java:98)
    2. android.os.Looper.loop(Looper.java:146)
    3. android.app.ActivityThread.main(ActivityThread.java:5678)
    3 frames
  7. Java RT
    Method.invoke
    1. java.lang.reflect.Method.invokeNative(Native Method)
    2. java.lang.reflect.Method.invoke(Method.java:515)
    2 frames
  8. Android
    ZygoteInit.main
    1. com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1291)
    2. com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1107)
    2 frames
  9. Android Platform
    NativeStart.main
    1. dalvik.system.NativeStart.main(Native Method)
    1 frame