{ "id": "116368", "key": "AC-2452", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "12217", "key": "AC", "name": "Appcelerator - INBOX", "projectCategory": { "id": "10000", "description": "", "name": "Customer Service" } }, "resolution": { "id": "8", "description": "", "name": "Needs more info" }, "resolutiondate": "2013-07-11T23:38:16.000+0000", "created": "2013-06-23T22:51:17.000+0000", "labels": [ "andoid", "crash", "startup" ], "versions": [], "issuelinks": [], "assignee": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "updated": "2016-03-08T07:41:29.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "14548", "name": "Titanium SDK & CLI", "description": "Please enter tickets related to the MobileSDK here." } ], "description": "My titanium Android app crashes once in 10 runs during the startup and it has the below signature. Please help me. These crashes will be seen Google App Console and is very bad for the app rank.\r\n\r\nMy app has stacked windows (modal window on top of modal window on top of modal window). During startup, my app registers for one of the windows focus, resume, close events.\r\n\r\n{code}\r\n297 06-23 01:00:22.837 8915 8915 D AndroidRuntime: Shutting down VM\r\n5298 06-23 01:00:22.837 8915 8915 W dalvikvm: threadid=1: thread exiting with uncaught exception (group=0x40ac1210)\r\n5299 06-23 01:00:22.845 8915 8915 E TiApplication: (main) [246,1049] Sending event: exception on thread: main msg:java.lang.NullPointerException; Titanium 3.1.0,2013/ 04/15 18:46,57634ef\r\n5300 06-23 01:00:22.845 8915 8915 E TiApplication: java.lang.NullPointerException\r\n5301 06-23 01:00:22.845 8915 8915 E TiApplication: at ti.modules.titanium.ui.TiUIActivityWindow.handleBooted(TiUIActivityWindow.java:194)\r\n5302 06-23 01:00:22.845 8915 8915 E TiApplication: at ti.modules.titanium.ui.TiUIActivityWindow$MessageHandler.handleMessage(TiUIActivityWindow.java:282)\r\n5303 06-23 01:00:22.845 8915 8915 E TiApplication: at android.os.Handler.dispatchMessage(Handler.java:95)\r\n5304 06-23 01:00:22.845 8915 8915 E TiApplication: at android.os.Looper.loop(Looper.java:137)\r\n5305 06-23 01:00:22.845 8915 8915 E TiApplication: at android.app.ActivityThread.main(ActivityThread.java:4722)\r\n5306 06-23 01:00:22.845 8915 8915 E TiApplication: at java.lang.reflect.Method.invokeNative(Native Method)\r\n5307 06-23 01:00:22.845 8915 8915 E TiApplication: at java.lang.reflect.Method.invoke(Method.java:511)\r\n5308 06-23 01:00:22.845 8915 8915 E TiApplication: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:787)\r\n5309 06-23 01:00:22.845 8915 8915 E TiApplication: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:554)\r\n5310 06-23 01:00:22.845 8915 8915 E TiApplication: at dalvik.system.NativeStart.main(Native Method)\r\n5311 06-23 01:00:22.845 8915 8915 E AndroidRuntime: FATAL EXCEPTION: main\r\n5312 06-23 01:00:22.845 8915 8915 E AndroidRuntime: java.lang.NullPointerException\r\n5313 06-23 01:00:22.845 8915 8915 E AndroidRuntime: at ti.modules.titanium.ui.TiUIActivityWindow.handleBooted(TiUIActivityWindow.java:194)\r\n5314 06-23 01:00:22.845 8915 8915 E AndroidRuntime: at ti.modules.titanium.ui.TiUIActivityWindow$MessageHandler.handleMessage(TiUIActivityWindow.java:282)\r\n5315 06-23 01:00:22.845 8915 8915 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:95)\r\n5316 06-23 01:00:22.845 8915 8915 E AndroidRuntime: at android.os.Looper.loop(Looper.java:137)\r\n5317 06-23 01:00:22.845 8915 8915 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:4722)\r\n5318 06-23 01:00:22.845 8915 8915 E AndroidRuntime: at java.lang.reflect.Method.invokeNative(Native Method)\r\n5319 06-23 01:00:22.845 8915 8915 E AndroidRuntime: at java.lang.reflect.Method.invoke(Method.java:511)\r\n5320 06-23 01:00:22.845 8915 8915 E AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:787)\r\n5321 06-23 01:00:22.845 8915 8915 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:554)\r\n5322 06-23 01:00:22.845 8915 8915 E AndroidRuntime: at dalvik.system.NativeStart.main(Native Method)\r\n{code}", "attachment": [], "flagged": false, "summary": "Android: App crashes during startup - TiUIActivityWindow.handleBooted", "creator": { "name": "manojpec", "key": "manojpec", "displayName": "Manoj", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "manojpec", "key": "manojpec", "displayName": "Manoj", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Titanium 3.1.0.GA SDK\r\nTitanium Studio 3.2\r\nAndorid api level 8", "comment": { "comments": [ { "id": "259205", "author": { "name": "dsefton", "key": "dsefton", "displayName": "Daniel Sefton", "active": true, "timeZone": "America/Los_Angeles" }, "body": "So is this happening in a production app which is in the Google Play Store? You didn't see this crash during development? Do you know if it occurs on specific devices? Do you use any modules?\r\n\r\nIt's going to be hard for us to diagnose the problem without being able to reproduce it. If you can reproduce it yourself - like you say, if you can reproduce the fact that it crashes every 10 runs, then that's great. From there you could try removing parts of the app until you can make a simple test case out of it, or if that's really not possible, you'd need to send us the app source.", "updateAuthor": { "name": "dsefton", "key": "dsefton", "displayName": "Daniel Sefton", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-06-24T18:21:18.000+0000", "updated": "2013-06-24T18:21:35.000+0000" }, { "id": "259230", "author": { "name": "manojpec", "key": "manojpec", "displayName": "Manoj", "active": true, "timeZone": "America/Los_Angeles" }, "body": "thanks for looking into this bug. Yes, this is happening with my production app - https://play.google.com/store/apps/details?id=in.moneymint.tamil.calendar\r\n\r\nI don't think this is device specific, as I can see this bug in emulator, in motorola atrix2 and also bunch of users with production app. Yes, I use few modules.\r\n\r\nI wish I recreated the problem with simple steps. Trying to recreate it by removing components one by one is going to be a nightmare for me. Appcelerator Q&A forum also has a very similar problem reported, but with no resolutions - http://developer.appcelerator.com/question/144082/nullpointerexception-at-timodulestitaniumuitiuiactivitywindowhandlebooted. This thread is talking about event listeners and my app also uses bunch of event listeners. What I have noticed is, the crash happens only during App resume ( launched the app fresh, hit back button till the app closes, launch the app again ). My question is, during app resume ..\r\n\r\n1. are all app js files (modules) loaded again ?\r\n2. are all app thrid party modules loaded again ?\r\n3. Since all the app windows were closed previously, what happens to all those window event listeners (close, focus, etc.,) ?\r\n4. Since the app is resumed, are all the window event listeners added again one more time ?\r\n\r\n== code flow ==\r\n\r\napp.js\r\n +---> appwindow.js\r\n +-----------> win1.js (crate win1, add event listeners, win1 open, win1 hide)\r\n +-----------> win2.js (create win2, add event listeners, win2 open)\r\n\r\nappwindow.js\r\n var Win2 = require (win2) \r\n win2 = new Win2()\r\n win2.open()\r\n\r\n\r\nwin2.js\r\n \r\n mywin = createWindow\r\n mywin.addEventListeners ...\r\n mywin.addEventListeners ...\r\n \r\n win2 {\r\n mywin.addEventListeners ...\r\n return win2\r\n } \r\n\r\n\r\n=== \r\n\r\n\r\n\r\n\r\n", "updateAuthor": { "name": "manojpec", "key": "manojpec", "displayName": "Manoj", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-06-24T19:37:01.000+0000", "updated": "2013-06-24T19:37:01.000+0000" }, { "id": "259256", "author": { "name": "dsefton", "key": "dsefton", "displayName": "Daniel Sefton", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I would still personally just create a new project, copy your app across and just try commenting stuff out, especially the event listeners. I'd be interested to know if it still happens after you comment out the event listeners. On app background/resume nothing is loaded again, but event listeners are called.", "updateAuthor": { "name": "dsefton", "key": "dsefton", "displayName": "Daniel Sefton", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-06-24T21:30:08.000+0000", "updated": "2013-06-24T21:30:22.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }