{ "id": "153598", "key": "TIMOB-20108", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [ { "id": "16997", "name": "Release 5.2.0", "archived": false, "released": true, "releaseDate": "2016-02-23" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2015-12-08T02:53:07.000+0000", "created": "2015-12-03T21:49:33.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [ "android", "crash" ], "versions": [], "issuelinks": [], "assignee": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "updated": "2016-02-05T00:15:35.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": "10202", "name": "Android", "description": "Android Platform" } ], "description": "We have found that *sometimes* on the Android platform when a user resumes out app it crashes immediately. To the user it looks like they click on the app icon and there is a black flash and they have to click the app icon again to launch it. I have attached a log from Critterism.\r\n\r\nFrom our testing and the logs it looks like it occurs when the app is backgrounded for a couple hours.\r\n\r\nAfter investigating the crash log it looks like the crash occurs in the \"TiBaseActivity\" class. The method \"callOrientationChangedListener\" is passed a null Activity object and the method fails to check for null before calling \"activity.getWindowManager()\".\r\n\r\nThe null activity is coming from TiApplication.getAppRootOrCurrentActivity(). I have not been able to determine a case there TiApplication.getAppRootOrCurrentActivity() should ever return null.", "attachment": [ { "id": "57671", "filename": "crash.log", "author": { "name": "CollinPrice", "key": "collinprice", "displayName": "Collin Price", "active": true, "timeZone": "America/Toronto" }, "created": "2015-12-03T21:45:40.000+0000", "size": 11332, "mimeType": "text/plain" } ], "flagged": false, "summary": "App sometimes crashes on resume", "creator": { "name": "CollinPrice", "key": "collinprice", "displayName": "Collin Price", "active": true, "timeZone": "America/Toronto" }, "subtasks": [], "reporter": { "name": "CollinPrice", "key": "collinprice", "displayName": "Collin Price", "active": true, "timeZone": "America/Toronto" }, "environment": "Android 4.0-6.0\r\nappc - 5.1.0\r\nappc ti - 5.0.2\r\nti sdk - 5.0.2.GA", "closedSprints": [ { "id": 536, "state": "closed", "name": "2015 Sprint 25 SDK", "startDate": "2015-12-05T01:30:40.415Z", "endDate": "2015-12-19T01:30:00.000Z", "completeDate": "2015-12-29T03:19:42.127Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "372101", "author": { "name": "CollinPrice", "key": "collinprice", "displayName": "Collin Price", "active": true, "timeZone": "America/Toronto" }, "body": "I have tested the SDK using a build that checks for null before performing the action in the callOrientationChangedListener method and this appears to have fixed the issue. This issue is hard to reproduce though.\r\n\r\n[PR|https://github.com/appcelerator/titanium_mobile/pull/7543] sent.", "updateAuthor": { "name": "CollinPrice", "key": "collinprice", "displayName": "Collin Price", "active": true, "timeZone": "America/Toronto" }, "created": "2015-12-03T21:56:30.000+0000", "updated": "2015-12-03T21:56:30.000+0000" }, { "id": "372124", "author": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "body": "[~CollinPrice] Thanks for the fix.\r\n\r\nHow exactly do I reproduce or test this crash out?", "updateAuthor": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "created": "2015-12-04T02:40:23.000+0000", "updated": "2015-12-04T02:40:23.000+0000" }, { "id": "372166", "author": { "name": "CollinPrice", "key": "collinprice", "displayName": "Collin Price", "active": true, "timeZone": "America/Toronto" }, "body": "One problem we have is that we cannot reliably recreate the crash. We have rarely seen the crash occur in person but we can see the stack trace from the crash logs in Critterism.\r\n\r\nIf you actually look in TiBaseActivity class you can see that its crashing in a place that is abstracted away in the Titanium SDK. Anyone using a Window object on Android might get this type of crash too.", "updateAuthor": { "name": "CollinPrice", "key": "collinprice", "displayName": "Collin Price", "active": true, "timeZone": "America/Toronto" }, "created": "2015-12-04T14:20:07.000+0000", "updated": "2015-12-04T14:20:07.000+0000" }, { "id": "372370", "author": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "body": "[~CollinPrice] We can probably get this reviewed and merged.", "updateAuthor": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "created": "2015-12-08T02:21:30.000+0000", "updated": "2015-12-08T02:21:30.000+0000" }, { "id": "372376", "author": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "body": "The code changes are in the `callOrientationChangedListener ` method. To ensure no regressions, test with this:-\r\n{code:javascript}\r\nvar win = Ti.UI.createWindow({\r\n});\r\n\r\nwin.open();\r\n\r\nTi.Gesture.addEventListener('orientationchange', function (event) {\r\n\r\n Ti.API.info('orientationchanged!');\r\n\r\n});\r\n{code}\r\n\r\nand this:-\r\n{code:javascript}\r\nvar win = Ti.UI.createWindow({\r\n});\r\n\r\nwin.open();\r\n{code}\r\n\r\nRotate the devices and ensure no crashes.", "updateAuthor": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "created": "2015-12-08T02:47:10.000+0000", "updated": "2015-12-08T02:47:22.000+0000" }, { "id": "372377", "author": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "body": "PR merged.", "updateAuthor": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "created": "2015-12-08T02:52:40.000+0000", "updated": "2015-12-08T02:52:40.000+0000" }, { "id": "372419", "author": { "name": "CollinPrice", "key": "collinprice", "displayName": "Collin Price", "active": true, "timeZone": "America/Toronto" }, "body": "Thanks for accepting the PR. I know this was a weird one.", "updateAuthor": { "name": "CollinPrice", "key": "collinprice", "displayName": "Collin Price", "active": true, "timeZone": "America/Toronto" }, "created": "2015-12-08T14:07:10.000+0000", "updated": "2015-12-08T14:07:10.000+0000" }, { "id": "372472", "author": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "body": "(y)", "updateAuthor": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "created": "2015-12-09T02:33:28.000+0000", "updated": "2015-12-09T02:33:28.000+0000" }, { "id": "376066", "author": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Verified the fix.\r\n\r\nKept the app in the background for 2 hrs & then resumed it, no crash seen.\r\n\r\nClosing.\r\n\r\nEnvironment:\r\nAppc Studio : 4.5.0.201601262138\r\nTi SDK : 5.2.0.v20160204140025\r\nTi CLI : 5.0.6\r\nAlloy : 1.7.33\r\nMAC Yosemite : 10.10.5\r\nAppc NPM : 4.2.3-2\r\nAppc CLI : 5.2.0-242\r\nNode: 4.2.2\r\nNexus 6P - Android 6.0\r\n", "updateAuthor": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-02-05T00:15:22.000+0000", "updated": "2016-02-05T00:15:22.000+0000" } ], "maxResults": 15, "total": 15, "startAt": 0 } } }