java.lang.NullPointerException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • After closing the last window on Android, when attempting to open a new window, the app crashes with the "Unfortunately app has stopped" message. Here is the stack trace that I get: {noformat} E/AndroidRuntime( 2450): FATAL EXCEPTION: main E/AndroidRuntime( 2450): Process: com.appdev.test, PID: 2450 E/AndroidRuntime( 2450): java.lang.NullPointerException E/AndroidRuntime( 2450): at android.content.ComponentName.<init>(ComponentName.java:77) E/AndroidRuntime( 2450): at android.content.Intent.<init>(Intent.java:3813) E/AndroidRuntime( 2450): at ti.modules.titanium.ui.WindowProxy.handleOpen(WindowProxy.java:128) E/AndroidRuntime( 2450): at org.appcelerator.titanium.proxy.TiWindowProxy.handleMessage(TiWindowProxy.java:88) E/AndroidRuntime( 2450): at ti.modules.titanium.ui.WindowProxy.handleMessage(WindowProxy.java:399) E/AndroidRuntime( 2450): at android.os.Handler.dispatchMessage(Handler.java:98) E/AndroidRuntime( 2450): at android.os.Looper.loop(Looper.java:136) E/AndroidRuntime( 2450): at android.app.ActivityThread.main(ActivityThread.java:5017) E/AndroidRuntime( 2450): at java.lang.reflect.Method.invokeNative(Native Method) E/AndroidRuntime( 2450): at java.lang.reflect.Method.invoke(Method.java:515) E/AndroidRuntime( 2450): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779) E/AndroidRuntime( 2450): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595) E/AndroidRuntime( 2450): at dalvik.system.NativeStart.main(Native Method) {noformat} Here is the test case that I am using: {code:javascript} var openWindow = function(index) { var window = Ti.UI.createWindow({ backgroundColor: 'white', title: 'Window ' + index }); var button = Ti.UI.createButton({ width: 80, height: 40, title: 'Button' }); button.addEventListener('click', function() { window.close(); openWindow(index + 1); }); window.add(button); window.open(); }; openWindow(1); {code} It successfully closes the first window but crashes when attempting to open the second window. It works when opening the second window before closing the first.
    via by Caleb Cox,
  • After closing the last window on Android, when attempting to open a new window, the app crashes with the "Unfortunately app has stopped" message. Here is the stack trace that I get: {noformat} E/AndroidRuntime( 2450): FATAL EXCEPTION: main E/AndroidRuntime( 2450): Process: com.appdev.test, PID: 2450 E/AndroidRuntime( 2450): java.lang.NullPointerException E/AndroidRuntime( 2450): at android.content.ComponentName.<init>(ComponentName.java:77) E/AndroidRuntime( 2450): at android.content.Intent.<init>(Intent.java:3813) E/AndroidRuntime( 2450): at ti.modules.titanium.ui.WindowProxy.handleOpen(WindowProxy.java:128) E/AndroidRuntime( 2450): at org.appcelerator.titanium.proxy.TiWindowProxy.handleMessage(TiWindowProxy.java:88) E/AndroidRuntime( 2450): at ti.modules.titanium.ui.WindowProxy.handleMessage(WindowProxy.java:399) E/AndroidRuntime( 2450): at android.os.Handler.dispatchMessage(Handler.java:98) E/AndroidRuntime( 2450): at android.os.Looper.loop(Looper.java:136) E/AndroidRuntime( 2450): at android.app.ActivityThread.main(ActivityThread.java:5017) E/AndroidRuntime( 2450): at java.lang.reflect.Method.invokeNative(Native Method) E/AndroidRuntime( 2450): at java.lang.reflect.Method.invoke(Method.java:515) E/AndroidRuntime( 2450): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779) E/AndroidRuntime( 2450): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595) E/AndroidRuntime( 2450): at dalvik.system.NativeStart.main(Native Method) {noformat} Here is the test case that I am using: {code:javascript} var openWindow = function(index) { var window = Ti.UI.createWindow({ backgroundColor: 'white', title: 'Window ' + index }); var button = Ti.UI.createButton({ width: 80, height: 40, title: 'Button' }); button.addEventListener('click', function() { window.close(); openWindow(index + 1); }); window.add(button); window.open(); }; openWindow(1); {code} It successfully closes the first window but crashes when attempting to open the second window. It works when opening the second window before closing the first.
    via by Caleb Cox,
  • 3.20.02 crashes
    via GitHub by ravelab
    ,
  • java.lang.NullPointerException
    via GitHub by banobi
    ,
  • java.lang.NullPointerException
    via GitHub by banobi
    ,
  • 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)
    via by josh rose,
  • 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)
    via by josh rose,
  • 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)
    via by Ygor Lemos,
  • Hi all. Let's say that we have heavyweight window that is opened. Calling "open" method of that window crashes application (exception message says: Unable to start activity). Here is source code that demonstrates the issue: {code:javascript|title=app.js} var win = Ti.UI.createWindow({ modal: true, backgroundColor: '#c96' }); win.open(); win.open(); {code} {code:title=log} 462 AndroidRuntime D >>>>>>>>>>>>>> AndroidRuntime START <<<<<<<<<<<<<< 462 AndroidRuntime D CheckJNI is ON 462 AndroidRuntime D --- registering native functions --- 96 ActivityManager I Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x 10000000 cmp=com.testing.testing7/.Testing7Activity } 462 AndroidRuntime D Shutting down VM 462 dalvikvm D Debugger has detached; object registry had 1 entries 462 AndroidRuntime I NOTE: attach of thread 'Binder Thread #3' failed 96 ActivityManager I Start proc com.testing.testing7 for activity com.testing.testing7/.Testing7Activity: pid=471 uid=10040 g ids={1015, 3003} 471 TiApplication I (main) [1,1] checkpoint, app created. 471 dalvikvm D GC_FOR_MALLOC freed 2825 objects / 315088 bytes in 68ms 471 TiApplication I (main) [650,651] Titanium 1.7.1 (2011/06/17 00:13 293a6d...) 471 TiDeployData D (main) [47,698] Read deploy data: {"debuggerPort":-1,"debuggerEnabled":false,"fastdevPort":60465} 471 TiDbHelper I (main) [115,813] No value in database for platform key: 'unique_machine_id' returning supplied default ' ' 471 TiDbHelper I (main) [18,831] No value in database for platform key: 'hardware_machine_id' returning supplied default '' 471 TiPlatformHelper E (main) [1,832] renaming ID 471 TiRootActivity I (main) [1,1] checkpoint, on root activity create, savedInstanceState: null 471 TiAnalyticsDb D (main) [22,23] Creating Database tianalytics.db 471 TiAnalyticsDb I (main) [4,27] Upgrading Database from 1 to 4 471 TiApplication E (main) [320,347] APP PROXY: [Ti.App] 471 dalvikvm D GC_FOR_MALLOC freed 4421 objects / 348992 bytes in 62ms 471 TiCommonContactsApi D (main) [92,439] Using newer contacts api. Android SDK level: 8 471 global I Default buffer size used in BufferedReader constructor. It would be better to be explicit if an 8k-char buffer is required. 471 dalvikvm D GC_FOR_MALLOC freed 5038 objects / 349864 bytes in 158ms 96 ActivityManager I Process android.process.acore (pid 245) has died. 38 qemud D fdhandler_accept_event: accepting on fd 10 38 qemud D created client 0x150b8 listening on fd 15 38 qemud D client_fd_receive: attempting registration for service 'sensors' 38 qemud D client_fd_receive: -> received channel id 8 38 qemud D client_registration: registration succeeded for client 8 38 qemud D fdhandler_event: disconnect on fd 15 471 TiFastDev D (kroll$1: app://app.js) [857,1296] Enabling Fastdev on port 60465 471 TiFastDev D (kroll$1: app://app.js) [19,1315] sent tokens successfully 471 TiFastDev D (kroll$1: app://app.js) [2,1317] Fastdev session handshake succesful. 471 TiFastDev D (kroll$1: app://app.js) [53,1370] sent tokens successfully 471 KrollContext D (kroll$1: app://app.js) [4,1374] Running evaluated script: file:///android_asset/Resources/app.js 471 global I Default buffer size used in BufferedReader constructor. It would be better to be explicit if an 8k-char buffer is required. 471 dalvikvm D GC_FOR_MALLOC freed 7232 objects / 482912 bytes in 76ms 96 ActivityManager I Starting activity: Intent { cmp=com.testing.testing7/org.appcelerator.titanium.TiModalActivity (has extr as) } 471 global I Default buffer size used in BufferedReader constructor. It would be better to be explicit if an 8k-char buffer is required. 471 dalvikvm D GC_FOR_MALLOC freed 5946 objects / 401024 bytes in 61ms 471 AndroidRuntime D Shutting down VM 471 dalvikvm W threadid=1: thread exiting with uncaught exception (group=0x4001d800) 471 TiUncaughtHandler E (main) [707,2081] Sending event: exception on thread: main msg:java.lang.RuntimeException: Unable to sta rt activity ComponentInfo{com.testing.testing7/com.testing.testing7.Testing7Activity}: java.lang.NullPoi nterException; Titanium 1.7.1,2011/06/17 00:13,293a6d... 471 TiUncaughtHandler E java.lang.RuntimeException: Unable to start activity ComponentInfo{com.testing.testing7/com.testing.test ing7.Testing7Activity}: java.lang.NullPointerException 471 TiUncaughtHandler E at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663) 471 TiUncaughtHandler E at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679) 471 TiUncaughtHandler E at android.app.ActivityThread.access$2300(ActivityThread.java:125) 471 TiUncaughtHandler E at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033) 471 TiUncaughtHandler E at android.os.Handler.dispatchMessage(Handler.java:99) 471 TiUncaughtHandler E at android.os.Looper.loop(Looper.java:123) 471 TiUncaughtHandler E at android.app.ActivityThread.main(ActivityThread.java:4627) 471 TiUncaughtHandler E at java.lang.reflect.Method.invokeNative(Native Method) 471 TiUncaughtHandler E at java.lang.reflect.Method.invoke(Method.java:521) 471 TiUncaughtHandler E at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868) 471 TiUncaughtHandler E at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626) 471 TiUncaughtHandler E at dalvik.system.NativeStart.main(Native Method) 471 TiUncaughtHandler E Caused by: java.lang.NullPointerException 471 TiUncaughtHandler E at android.content.ComponentName.<init>(ComponentName.java:75) 471 TiUncaughtHandler E at android.content.Intent.<init>(Intent.java:2678) 471 TiUncaughtHandler E at ti.modules.titanium.ui.TiUIWindow.createIntent(TiUIWindow.java:527) 471 TiUncaughtHandler E at ti.modules.titanium.ui.TiUIWindow.createNewActivity(TiUIWindow.java:194) 471 TiUncaughtHandler E at ti.modules.titanium.ui.TiUIWindow.<init>(TiUIWindow.java:105) 471 TiUncaughtHandler E at ti.modules.titanium.ui.WindowProxy.handleOpen(WindowProxy.java:99) 471 TiUncaughtHandler E at org.appcelerator.titanium.proxy.TiWindowProxy.handleMessage(TiWindowProxy.java:86) 471 TiUncaughtHandler E at ti.modules.titanium.ui.WindowProxy.handleMessage(WindowProxy.java:86) 471 TiUncaughtHandler E at android.os.Handler.dispatchMessage(Handler.java:95) 471 TiUncaughtHandler E at org.appcelerator.titanium.TiMessageQueue.dispatchMessage(TiMessageQueue.java:320) 471 TiUncaughtHandler E at org.appcelerator.titanium.TiMessageQueue.dispatchPendingMessages(TiMessageQueue.java:304) 471 TiUncaughtHandler E at org.appcelerator.titanium.TiMessageQueue$2.getResult(TiMessageQueue.java:172) 471 TiUncaughtHandler E at org.appcelerator.titanium.TiMessageQueue.sendBlockingMessage(TiMessageQueue.java:196) 471 TiUncaughtHandler E at org.appcelerator.titanium.kroll.KrollContext.evalFile(KrollContext.java:277) 471 TiUncaughtHandler E at org.appcelerator.titanium.kroll.KrollBridge.evalFile(KrollBridge.java:130) 471 TiUncaughtHandler E at org.appcelerator.titanium.TiContext.evalFile(TiContext.java:190) 471 TiUncaughtHandler E at org.appcelerator.titanium.TiContext.evalFile(TiContext.java:210) 471 TiUncaughtHandler E at org.appcelerator.titanium.TiLaunchActivity.loadActivityScript(TiLaunchActivity.java:71) 471 TiUncaughtHandler E at org.appcelerator.titanium.TiLaunchActivity.windowCreated(TiLaunchActivity.java:112) 471 TiUncaughtHandler E at org.appcelerator.titanium.TiBaseActivity.onCreate(TiBaseActivity.java:294) 471 TiUncaughtHandler E at org.appcelerator.titanium.TiLaunchActivity.onCreate(TiLaunchActivity.java:102) 471 TiUncaughtHandler E at org.appcelerator.titanium.TiRootActivity.onCreate(TiRootActivity.java:38) 471 TiUncaughtHandler E at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047) 471 TiUncaughtHandler E at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627) 471 TiUncaughtHandler E ... 11 more 471 AndroidRuntime E FATAL EXCEPTION: main 471 AndroidRuntime E java.lang.RuntimeException: Unable to start activity ComponentInfo{com.testing.testing7/com.testing.test ing7.Testing7Activity}: java.lang.NullPointerException 471 AndroidRuntime E at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663) 471 AndroidRuntime E at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679) 471 AndroidRuntime E at android.app.ActivityThread.access$2300(ActivityThread.java:125) 471 AndroidRuntime E at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033) 471 AndroidRuntime E at android.os.Handler.dispatchMessage(Handler.java:99) 471 AndroidRuntime E at android.os.Looper.loop(Looper.java:123) 471 AndroidRuntime E at android.app.ActivityThread.main(ActivityThread.java:4627) 471 AndroidRuntime E at java.lang.reflect.Method.invokeNative(Native Method) 471 AndroidRuntime E at java.lang.reflect.Method.invoke(Method.java:521) 471 AndroidRuntime E at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868) 471 AndroidRuntime E at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626) 471 AndroidRuntime E at dalvik.system.NativeStart.main(Native Method) 471 AndroidRuntime E Caused by: java.lang.NullPointerException 471 AndroidRuntime E at android.content.ComponentName.<init>(ComponentName.java:75) 471 AndroidRuntime E at android.content.Intent.<init>(Intent.java:2678) 471 AndroidRuntime E at ti.modules.titanium.ui.TiUIWindow.createIntent(TiUIWindow.java:527) 471 AndroidRuntime E at ti.modules.titanium.ui.TiUIWindow.createNewActivity(TiUIWindow.java:194) 471 AndroidRuntime E at ti.modules.titanium.ui.TiUIWindow.<init>(TiUIWindow.java:105) 471 AndroidRuntime E at ti.modules.titanium.ui.WindowProxy.handleOpen(WindowProxy.java:99) 471 AndroidRuntime E at org.appcelerator.titanium.proxy.TiWindowProxy.handleMessage(TiWindowProxy.java:86) 471 AndroidRuntime E at ti.modules.titanium.ui.WindowProxy.handleMessage(WindowProxy.java:86) 471 AndroidRuntime E at android.os.Handler.dispatchMessage(Handler.java:95) 471 AndroidRuntime E at org.appcelerator.titanium.TiMessageQueue.dispatchMessage(TiMessageQueue.java:320) 471 AndroidRuntime E at org.appcelerator.titanium.TiMessageQueue.dispatchPendingMessages(TiMessageQueue.java:304) 471 AndroidRuntime E at org.appcelerator.titanium.TiMessageQueue$2.getResult(TiMessageQueue.java:172) 471 AndroidRuntime E at org.appcelerator.titanium.TiMessageQueue.sendBlockingMessage(TiMessageQueue.java:196) 471 AndroidRuntime E at org.appcelerator.titanium.kroll.KrollContext.evalFile(KrollContext.java:277) 471 AndroidRuntime E at org.appcelerator.titanium.kroll.KrollBridge.evalFile(KrollBridge.java:130) 471 AndroidRuntime E at org.appcelerator.titanium.TiContext.evalFile(TiContext.java:190) 471 AndroidRuntime E at org.appcelerator.titanium.TiContext.evalFile(TiContext.java:210) 471 AndroidRuntime E at org.appcelerator.titanium.TiLaunchActivity.loadActivityScript(TiLaunchActivity.java:71) 471 AndroidRuntime E at org.appcelerator.titanium.TiLaunchActivity.windowCreated(TiLaunchActivity.java:112) 471 AndroidRuntime E at org.appcelerator.titanium.TiBaseActivity.onCreate(TiBaseActivity.java:294) 471 AndroidRuntime E at org.appcelerator.titanium.TiLaunchActivity.onCreate(TiLaunchActivity.java:102) 471 AndroidRuntime E at org.appcelerator.titanium.TiRootActivity.onCreate(TiRootActivity.java:38) 471 AndroidRuntime E at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047) 471 AndroidRuntime E at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627) 471 AndroidRuntime E ... 11 more 96 ARMAssembler I generated scanline__00000077:03515104_00000000_00000000 [ 33 ipp] (47 ins) at [0x375890:0x37594c] in 328 2379 ns 96 ActivityManager W Activity pause timeout for HistoryRecord{44e77150 com.testing.testing7/.Testing7Activity} 96 ActivityManager W Activity idle timeout for HistoryRecord{44e77150 com.testing.testing7/.Testing7Activity} 96 ActivityManager W Activity idle timeout for HistoryRecord{44fdf3d0 com.testing.testing7/org.appcelerator.titanium.TiModalA ctivity} 265 dalvikvm D GC_EXPLICIT freed 2169 objects / 110744 bytes in 76ms 96 ActivityManager W Timeout executing service: ServiceRecord{45198b90 com.testing.testing7/org.appcelerator.titanium.analyti cs.TiAnalyticsService} 96 ActivityManager I Crashing app skipping ANR: ProcessRecord{44fa76f8 471:com.testing.testing7/10040} Executing service com. testing.testing7/org.appcelerator.titanium.analytics.TiAnalyticsService {code} Comment out "modal: true" and it won't crash. {code:javascript|title=app.js} var win = Ti.UI.createWindow({ // modal: true, backgroundColor: '#c96' }); win.open(); win.open(); {code} {code:title=log} 492 AndroidRuntime D >>>>>>>>>>>>>> AndroidRuntime START <<<<<<<<<<<<<< 492 AndroidRuntime D CheckJNI is ON 492 AndroidRuntime D --- registering native functions --- 96 ActivityManager I Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x 10000000 cmp=com.testing.testing7/.Testing7Activity } 492 AndroidRuntime D Shutting down VM 492 dalvikvm D Debugger has detached; object registry had 1 entries 96 ActivityManager I Start proc com.testing.testing7 for activity com.testing.testing7/.Testing7Activity: pid=498 uid=10040 g ids={1015, 3003} 492 AndroidRuntime I NOTE: attach of thread 'Binder Thread #3' failed 33 dalvikvm D GC_EXPLICIT freed 285 objects / 10824 bytes in 587ms 33 dalvikvm D GC_EXPLICIT freed 47 objects / 2080 bytes in 138ms 33 dalvikvm D GC_EXPLICIT freed 2 objects / 64 bytes in 338ms 498 TiApplication I (main) [0,0] checkpoint, app created. 96 NotificationService W Object died trying to hide notification android.app.ITransientNotification$Stub$Proxy@450064d0 in packag e com.testing.testing7 96 ActivityManager W setProcessForeground called on unknown pid: 471 498 dalvikvm D GC_FOR_MALLOC freed 2852 objects / 316112 bytes in 67ms 498 TiApplication I (main) [671,671] Titanium 1.7.1 (2011/06/17 00:13 293a6d...) 498 TiDeployData D (main) [55,726] Read deploy data: {"debuggerPort":-1,"debuggerEnabled":false,"fastdevPort":60465} 498 TiPlatformHelper E (main) [81,807] renaming ID 498 TiRootActivity I (main) [0,0] checkpoint, on root activity create, savedInstanceState: null 498 TiApplication E (main) [201,201] APP PROXY: [Ti.App] 498 TiCommonContactsApi D (main) [21,222] Using newer contacts api. Android SDK level: 8 498 dalvikvm D GC_FOR_MALLOC freed 4750 objects / 341744 bytes in 68ms 498 global I Default buffer size used in BufferedReader constructor. It would be better to be explicit if an 8k-char buffer is required. 498 dalvikvm D GC_FOR_MALLOC freed 4743 objects / 332640 bytes in 55ms 38 qemud D fdhandler_accept_event: accepting on fd 10 38 qemud D created client 0x150b8 listening on fd 15 38 qemud D client_fd_receive: attempting registration for service 'sensors' 38 qemud D client_fd_receive: -> received channel id 9 38 qemud D client_registration: registration succeeded for client 9 38 qemud D fdhandler_event: disconnect on fd 15 498 TiFastDev D (kroll$1: app://app.js) [566,788] Enabling Fastdev on port 60465 498 TiFastDev D (kroll$1: app://app.js) [18,806] sent tokens successfully 498 TiFastDev D (kroll$1: app://app.js) [3,809] Fastdev session handshake succesful. 498 TiFastDev D (kroll$1: app://app.js) [61,870] sent tokens successfully 498 KrollContext D (kroll$1: app://app.js) [3,873] Running evaluated script: file:///android_asset/Resources/app.js 498 TiRootActivity I (main) [0,0] checkpoint, on root activity resume. context = org.appcelerator.titanium.TiContext@44f5c170 498 TiAnalyticsSvc I (main) [43,43] Send already in progress, skipping intent 498 TiAnalyticsSvc W (Thread-11) [2,45] Analytics Service Started 498 TiAnalyticsSvc I (main) [15,60] Send already in progress, skipping intent 498 TiAnalyticsSvc W (Thread-12) [66,126] Analytics Service Started 498 TiAnalyticsSvc W (Thread-13) [1,127] Analytics Service Started 96 ActivityManager I Displayed activity com.testing.testing7/.Testing7Activity: 4625 ms (total 189518 ms) 498 dalvikvm D GC_FOR_MALLOC freed 6864 objects / 521216 bytes in 275ms 498 TiAnalyticsSvc I (Thread-12) [1643,1770] Sending 4 analytics events. 498 TiAnalyticsSvc I (Thread-11) [16,1786] Sending 4 analytics events. 498 TiAnalyticsSvc I (Thread-13) [17,1803] Sending 4 analytics events. 498 dalvikvm D GC_FOR_MALLOC freed 1025 objects / 205936 bytes in 80ms 498 dalvikvm D GC_FOR_MALLOC freed 5307 objects / 306664 bytes in 82ms 498 TiAnalyticsSvc W (Thread-11) [1431,3234] Stopping Analytics Service 498 dalvikvm D GC_FOR_MALLOC freed 4190 objects / 285272 bytes in 89ms 498 dalvikvm D GC_FOR_MALLOC freed 5038 objects / 450584 bytes in 63ms 498 NativeCrypto D Freeing OpenSSL session 498 TiAnalyticsSvc W (Thread-12) [718,3952] Stopping Analytics Service 498 TiAnalyticsSvc W (Thread-12) [4,3956] Expected to be in a sending state. Sending was already false. 498 TiAnalyticsSvc W (Thread-13) [149,4105] Stopping Analytics Service 498 TiAnalyticsSvc W (Thread-13) [13,4118] Expected to be in a sending state. Sending was already false. 265 dalvikvm D GC_EXPLICIT freed 411 objects / 23200 bytes in 72ms {code} If you need more info, please let me know.
    via by Ivan Skugor,
  • h4.NOTE: This is an intermittent issue. I could reproduce it 4-5 times with sdk 3.2.3.v20140422101718 & once with sdk 3.2.2.GA. So I guess this is not regression. h5. Description: 1. Create an app alloy or classic. 2. Set a breakpoint in the app for debug. 3. Debug it on device. h5. Actual Result: 1. The app crashes and we get "the app has stopped working" message. 2. Alan saw some timing issue while opening the window: {code} @Override protected void handleOpen(KrollDict options) { Activity topActivity = TiApplication.getAppCurrentActivity(); Intent intent = new Intent(topActivity, TiActivity.class); //It's is crashing on this line (198) where topActivity is null fillIntent(topActivity, intent); {code} 3. My console logs: {code} E/TiApplication( 9518): java.lang.RuntimeException: Unable to pause activity {com.app.xalloy/com.app.xalloy.XalloyActivity}: java.lang.NullPointerException E/TiApplication( 9518): at android.app.ActivityThread.performPauseActivity(ActivityThread.java:3016) E/TiApplication( 9518): at android.app.ActivityThread.performPauseActivity(ActivityThread.java:2971) E/TiApplication( 9518): at android.app.ActivityThread.handlePauseActivity(ActivityThread.java:2949) E/TiApplication( 9518): at android.app.ActivityThread.access$800(ActivityThread.java:141) E/TiApplication( 9518): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1251) E/TiApplication( 9518): at android.os.Handler.dispatchMessage(Handler.java:99) E/TiApplication( 9518): at android.os.Looper.loop(Looper.java:137) E/TiApplication( 9518): at android.app.ActivityThread.main(ActivityThread.java:5039) E/TiApplication( 9518): at java.lang.reflect.Method.invokeNative(Native Method) E/TiApplication( 9518): at java.lang.reflect.Method.invoke(Method.java:511) E/TiApplication( 9518): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793) E/TiApplication( 9518): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560) E/TiApplication( 9518): at dalvik.system.NativeStart.main(Native Method) E/TiApplication( 9518): Caused by: java.lang.NullPointerException E/TiApplication( 9518): at android.content.ComponentName.<init>(ComponentName.java:75) E/TiApplication( 9518): at android.content.Intent.<init>(Intent.java:3491) E/TiApplication( 9518): at ti.modules.titanium.ui.WindowProxy.handleOpen(WindowProxy.java:198) E/TiApplication( 9518): at org.appcelerator.titanium.proxy.TiWindowProxy.handleMessage(TiWindowProxy.java:89) E/TiApplication( 9518): at ti.modules.titanium.ui.WindowProxy.handleMessage(WindowProxy.java:443) E/TiApplication( 9518): at android.os.Handler.dispatchMessage(Handler.java:95) E/TiApplication( 9518): at org.appcelerator.kroll.common.TiMessenger.dispatchMessage(TiMessenger.java:389) E/TiApplication( 9518): at org.appcelerator.kroll.common.TiMessenger.dispatchPendingMessages(TiMessenger.java:374) E/TiApplication( 9518): at org.appcelerator.kroll.common.TiMessenger$2.getResult(TiMessenger.java:252) E/TiApplication( 9518): at org.appcelerator.kroll.common.TiMessenger.sendBlockingMessage(TiMessenger.java:286) E/TiApplication( 9518): at org.appcelerator.kroll.common.TiMessenger.sendBlockingRuntimeMessage(TiMessenger.java:186) E/TiApplication( 9518): at org.appcelerator.kroll.KrollProxy.fireSyncEvent(KrollProxy.java:763) E/TiApplication( 9518): at org.appcelerator.titanium.TiBaseActivity.onPause(TiBaseActivity.java:975) E/TiApplication( 9518): at org.appcelerator.titanium.TiLaunchActivity.onPause(TiLaunchActivity.java:338) E/TiApplication( 9518): at android.app.Activity.performPause(Activity.java:5206) E/TiApplication( 9518): at android.app.Instrumentation.callActivityOnPause(Instrumentation.java:1226) E/TiApplication( 9518): at android.app.ActivityThread.performPauseActivity(ActivityThread.java:3002) E/TiApplication( 9518): ... 12 more E/AndroidRuntime( 9518): FATAL EXCEPTION: main E/AndroidRuntime( 9518): java.lang.RuntimeException: Unable to pause activity {com.app.xalloy/com.app.xalloy.XalloyActivity}: java.lang.NullPointerException E/AndroidRuntime( 9518): at android.app.ActivityThread.performPauseActivity(ActivityThread.java:3016) E/AndroidRuntime( 9518): at android.app.ActivityThread.performPauseActivity(ActivityThread.java:2971) E/AndroidRuntime( 9518): at android.app.ActivityThread.handlePauseActivity(ActivityThread.java:2949) E/AndroidRuntime( 9518): at android.app.ActivityThread.access$800(ActivityThread.java:141) E/AndroidRuntime( 9518): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1251) E/AndroidRuntime( 9518): at android.os.Handler.dispatchMessage(Handler.java:99) E/AndroidRuntime( 9518): at android.os.Looper.loop(Looper.java:137) E/AndroidRuntime( 9518): at android.app.ActivityThread.main(ActivityThread.java:5039) E/AndroidRuntime( 9518): at java.lang.reflect.Method.invokeNative(Native Method) E/AndroidRuntime( 9518): at java.lang.reflect.Method.invoke(Method.java:511) E/AndroidRuntime( 9518): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793) E/AndroidRuntime( 9518): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560) E/AndroidRuntime( 9518): at dalvik.system.NativeStart.main(Native Method) E/AndroidRuntime( 9518): Caused by: java.lang.NullPointerException E/AndroidRuntime( 9518): at android.content.ComponentName.<init>(ComponentName.java:75) E/AndroidRuntime( 9518): at android.content.Intent.<init>(Intent.java:3491) E/AndroidRuntime( 9518): at ti.modules.titanium.ui.WindowProxy.handleOpen(WindowProxy.java:198) E/AndroidRuntime( 9518): at org.appcelerator.titanium.proxy.TiWindowProxy.handleMessage(TiWindowProxy.java:89) E/AndroidRuntime( 9518): at ti.modules.titanium.ui.WindowProxy.handleMessage(WindowProxy.java:443) E/AndroidRuntime( 9518): at android.os.Handler.dispatchMessage(Handler.java:95) E/AndroidRuntime( 9518): at org.appcelerator.kroll.common.TiMessenger.dispatchMessage(TiMessenger.java:389) E/AndroidRuntime( 9518): at org.appcelerator.kroll.common.TiMessenger.dispatchPendingMessages(TiMessenger.java:374) E/AndroidRuntime( 9518): at org.appcelerator.kroll.common.TiMessenger$2.getResult(TiMessenger.java:252) E/AndroidRuntime( 9518): at org.appcelerator.kroll.common.TiMessenger.sendBlockingMessage(TiMessenger.java:286) E/AndroidRuntime( 9518): at org.appcelerator.kroll.common.TiMessenger.sendBlockingRuntimeMessage(TiMessenger.java:186) E/AndroidRuntime( 9518): at org.appcelerator.kroll.KrollProxy.fireSyncEvent(KrollProxy.java:763) E/AndroidRuntime( 9518): at org.appcelerator.titanium.TiBaseActivity.onPause(TiBaseActivity.java:975) E/AndroidRuntime( 9518): at org.appcelerator.titanium.TiLaunchActivity.onPause(TiLaunchActivity.java:338) E/AndroidRuntime( 9518): at android.app.Activity.performPause(Activity.java:5206) E/AndroidRuntime( 9518): at android.app.Instrumentation.callActivityOnPause(Instrumentation.java:1226) E/AndroidRuntime( 9518): at android.app.ActivityThread.performPauseActivity(ActivityThread.java:3002) E/AndroidRuntime( 9518): ... 12 more D/overlay ( 161): FROM_STATE = OV_BYPASS_3_LAYER TO_STATE = OV_CLOSED I/v8 ( 9752): Failed to open socket on port 2525, waiting 1000 ms before retrying {code} h5. Expected Result: 1. The app should not crash & successfully launch.
    via by Lokesh Choudhary,
    • java.lang.NullPointerException at android.content.ComponentName.<init>(ComponentName.java:77) at android.content.Intent.<init>(Intent.java:3813) at ti.modules.titanium.ui.WindowProxy.handleOpen(WindowProxy.java:128) at org.appcelerator.titanium.proxy.TiWindowProxy.handleMessage(TiWindowProxy.java:88) at ti.modules.titanium.ui.WindowProxy.handleMessage(WindowProxy.java:399) at android.os.Handler.dispatchMessage(Handler.java:98) at android.os.Looper.loop(Looper.java:136) at android.app.ActivityThread.main(ActivityThread.java:5017) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:515) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595) at dalvik.system.NativeStart.main(Native Method)

    Users with the same issue

    Unknown visitor
    Unknown visitor1 times, last one,
    Unknown visitor
    Unknown visitor1 times, last one,
    Unknown visitor
    Unknown visitor1 times, last one,
    Unknown visitor
    Unknown visitor1 times, last one,
    Unknown visitor
    Unknown visitor1 times, last one,
    10 more bugmates