{ "id": "168446", "key": "TIMOB-24839", "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": "19572", "description": "Important fixes for 6.1.0", "name": "Release 6.1.1", "archived": false, "released": true, "releaseDate": "2017-06-16" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2017-06-19T20:38:46.000+0000", "created": "2017-06-16T03:50:20.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [ "android", "api", "parity", "regression" ], "versions": [ { "id": "17608", "name": "Release 6.1.0", "archived": false, "released": true, "releaseDate": "2017-05-26" }, { "id": "19572", "description": "Important fixes for 6.1.0", "name": "Release 6.1.1", "archived": false, "released": true, "releaseDate": "2017-06-16" } ], "issuelinks": [ { "id": "55265", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "168541", "key": "TIMOB-24870", "fields": { "summary": "Android: Reopening a closed window causes all components in the window to be lost", "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" } }, "priority": { "name": "Critical", "id": "1" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-06-21T16: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": "10202", "name": "Android", "description": "Android Platform" } ], "description": "Environment: 6.1.1.v20170615113917 Android 7.1.2 Device: OnePlus One (A0001) \r\n\r\nAffected version 6.1.0\r\n\r\n`\r\nvar egWindow = Ti.UI.createWindow({\r\n width: Ti.UI.FILL,\r\n height: Ti.UI.FILL,\r\n backgroundColor: 'red'\r\n});\r\n\r\n$.addListener($.button, 'click', function(){\r\n egWindow.open();\r\n});\r\n`\r\n\r\nonce the window is open, click the back button to close the window, and click the window again to open the window and the app crashes. This didn't use to be the case in 6.0.4.\r\n\r\nCrash Log: https://s3-ap-southeast-1.amazonaws.com/uploads-ap.hipchat.com/56929/750866/TQ8ifcaui4kpuoU/Crash_Log.txt\r\n", "attachment": [], "flagged": false, "summary": "Android: Reopening a closed window crashes the app", "creator": { "name": "fahad86", "key": "fahad86", "displayName": "Muhammad Ahmed Fahad", "active": true, "timeZone": "Asia/Shanghai" }, "subtasks": [], "reporter": { "name": "fahad86", "key": "fahad86", "displayName": "Muhammad Ahmed Fahad", "active": true, "timeZone": "Asia/Shanghai" }, "environment": null, "comment": { "comments": [ { "id": "422138", "author": { "name": "fahad86", "key": "fahad86", "displayName": "Muhammad Ahmed Fahad", "active": true, "timeZone": "Asia/Shanghai" }, "body": "Please can anyone look at this ASAP? Without this fixed, our app would be pretty much unusable. Also we need this version of the SDK as we need support for modules with .aar libs.", "updateAuthor": { "name": "fahad86", "key": "fahad86", "displayName": "Muhammad Ahmed Fahad", "active": true, "timeZone": "Asia/Shanghai" }, "created": "2017-06-16T08:59:05.000+0000", "updated": "2017-06-16T08:59:05.000+0000" }, { "id": "422143", "author": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "body": "[~fahad86] Thanks for this report! I'm moving this across to TIMOB\r\n\r\nCan reproduce this using:\r\n\r\nSDK: 6.1.0.GA, 6.1.1.v20170615113917\r\nAppc CLI: 6.2.2\r\nAppc NPM: 4.2.9\r\nOnePlus 3 7.1.1\r\n\r\n{code: app.js}\r\nvar win1 = Ti.UI.createWindow({\r\n\tbackgroundColor: 'blue',\r\n\ttitle: 'Blue'\r\n});\r\nvar win2 = Ti.UI.createWindow({\r\n\tbackgroundColor: 'red',\r\n\ttitle: 'Red'\r\n});\r\nwin1.addEventListener('click', function() {\r\n\twin2.open();\r\n\twin1.close();\r\n});\r\nwin2.addEventListener('click', function() {\r\n\twin1.open();\r\n\twin2.close();\r\n});\r\nwin1.open();\r\n{code}\r\n\r\nCrash log https://gist.github.com/ewanharris/f5e4105115ea85f4a5a0c4a4e93a7b0d (too big for jira)", "updateAuthor": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "created": "2017-06-16T09:46:35.000+0000", "updated": "2017-06-16T09:46:35.000+0000" }, { "id": "422146", "author": { "name": "fahad86", "key": "fahad86", "displayName": "Muhammad Ahmed Fahad", "active": true, "timeZone": "Asia/Shanghai" }, "body": "Thanks Ewan!\r\n\r\nCurious. Can I expect the fix in 6.1.1.GA (i.e. Fix Version/s: 6.1.1)?", "updateAuthor": { "name": "fahad86", "key": "fahad86", "displayName": "Muhammad Ahmed Fahad", "active": true, "timeZone": "Asia/Shanghai" }, "created": "2017-06-16T10:05:15.000+0000", "updated": "2017-06-16T10:05:36.000+0000" }, { "id": "422147", "author": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "body": "master: https://github.com/appcelerator/titanium_mobile/pull/9145\r\n6_1_X: https://github.com/appcelerator/titanium_mobile/pull/9146", "updateAuthor": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-06-16T10:26:54.000+0000", "updated": "2017-06-16T10:26:54.000+0000" }, { "id": "422293", "author": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "body": "FR Passed for both master & backport PR.", "updateAuthor": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-06-19T20:38:46.000+0000", "updated": "2017-06-19T20:38:46.000+0000" }, { "id": "422324", "author": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Verified the fix with SDK's 6.2.0.v20170619134258 & 6.1.1.v20170619143158.\r\nReopening a closed window does not crash the app.\r\n\r\nClosing.\r\n\r\nStudio Ver: 4.9.0.201705302345\r\nOS Ver: 10.12.3\r\nXcode Ver: Xcode 8.3.3\r\nAppc NPM: 4.2.9\r\nAppc CLI: 6.2.2\r\nTi CLI Ver: 5.0.14\r\nAlloy Ver: 1.9.11\r\nNode Ver: 6.10.1\r\nJava Ver: 1.8.0_101\r\nDevices: ⇨ google Pixel --- Android 7.1.1\r\n ⇨ google Nexus 5 --- Android 6.0.1\r\n\r\n", "updateAuthor": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-06-19T22:25:53.000+0000", "updated": "2017-06-19T22:26:01.000+0000" }, { "id": "422342", "author": { "name": "fahad86", "key": "fahad86", "displayName": "Muhammad Ahmed Fahad", "active": true, "timeZone": "Asia/Shanghai" }, "body": "Trying 6.1.1.v20170619143158, and I still see some issues. Looks like the view proxy is getting reset and when I try to re-open the window, all I see is a blank (white) screen. When I invoke a function which modifies a list view inside the closed window, I get the error:\r\n\r\n\"Uncaught Attempt to invoke virtual method 'android.content.res.Resources android.content.Context.getResources()' on a null object reference\"\r\n\r\nI'm using nl.fokkezb.infiniteScroll widget to load data on the List view inside the window.", "updateAuthor": { "name": "fahad86", "key": "fahad86", "displayName": "Muhammad Ahmed Fahad", "active": true, "timeZone": "Asia/Shanghai" }, "created": "2017-06-20T02:48:41.000+0000", "updated": "2017-06-20T02:48:41.000+0000" }, { "id": "422343", "author": { "name": "fahad86", "key": "fahad86", "displayName": "Muhammad Ahmed Fahad", "active": true, "timeZone": "Asia/Shanghai" }, "body": "So in essence the window could be re-opened without crash but everything added or attached to the window is already gone, which defeats the purpose.", "updateAuthor": { "name": "fahad86", "key": "fahad86", "displayName": "Muhammad Ahmed Fahad", "active": true, "timeZone": "Asia/Shanghai" }, "created": "2017-06-20T02:58:04.000+0000", "updated": "2017-06-20T02:58:04.000+0000" }, { "id": "422344", "author": { "name": "fahad86", "key": "fahad86", "displayName": "Muhammad Ahmed Fahad", "active": true, "timeZone": "Asia/Shanghai" }, "body": "I did a diff of the TiBaseActivity.java of 6_0_X and found that the bug may be occurring due to the logic change in the method `onBackPressed`\r\n\r\nKindly verify the code change here\r\n\t\t\t// check Ti.UI.Window.exitOnClose and either\r\n\t\t\t// exit the application or send to background\r\n\t\t\tif (topWindow != null) {\r\n\t\t\t\tboolean exitOnClose = TiConvert.toBoolean(topWindow.getProperty(TiC.PROPERTY_EXIT_ON_CLOSE), false);\r\n\r\n\t\t\t\t// root window should exitOnClose by default\r\n\t\t\t\tif (totalWindowStack <= 1 && !topWindow.hasProperty(TiC.PROPERTY_EXIT_ON_CLOSE)) {\r\n\t\t\t\t\texitOnClose = true;\r\n\t\t\t\t}\r\n\t\t\t\tif (exitOnClose) {\r\n\t\t\t\t\tLog.d(TAG, \"onBackPressed: exit\");\r\n\t\t\t\t\tif (Build.VERSION.SDK_INT >= 16) {\r\n\t\t\t\t\t\tfinishAffinity();\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tTiApplication.terminateActivityStack();\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn;\r\n\r\n\t\t\t\t// root window has exitOnClose set as false, send to background\r\n\t\t\t\t} else if (totalWindowStack <= 1) {\r\n\t\t\t\t\tLog.d(TAG, \"onBackPressed: suspend to background\");\r\n\t\t\t\t\tthis.moveTaskToBack(true);\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\tremoveWindowFromStack(topWindow);\r\n\t\t\t}", "updateAuthor": { "name": "fahad86", "key": "fahad86", "displayName": "Muhammad Ahmed Fahad", "active": true, "timeZone": "Asia/Shanghai" }, "created": "2017-06-20T03:22:45.000+0000", "updated": "2017-06-20T03:22:45.000+0000" }, { "id": "422345", "author": { "name": "fahad86", "key": "fahad86", "displayName": "Muhammad Ahmed Fahad", "active": true, "timeZone": "Asia/Shanghai" }, "body": "\t\t\t\t// root window should exitOnClose by default\r\n\t\t\t\tif (totalWindowStack <= 1 && {color:red}*!*{color}topWindow.hasProperty(TiC.PROPERTY_EXIT_ON_CLOSE)) {\r\n\t\t\t\t\texitOnClose = true;\r\n\t\t\t\t}\r\n\r\ntypo in highlighted in red?", "updateAuthor": { "name": "fahad86", "key": "fahad86", "displayName": "Muhammad Ahmed Fahad", "active": true, "timeZone": "Asia/Shanghai" }, "created": "2017-06-20T03:27:01.000+0000", "updated": "2017-06-20T03:27:01.000+0000" }, { "id": "422353", "author": { "name": "fahad86", "key": "fahad86", "displayName": "Muhammad Ahmed Fahad", "active": true, "timeZone": "Asia/Shanghai" }, "body": "Please re-open", "updateAuthor": { "name": "fahad86", "key": "fahad86", "displayName": "Muhammad Ahmed Fahad", "active": true, "timeZone": "Asia/Shanghai" }, "created": "2017-06-20T08:00:19.000+0000", "updated": "2017-06-20T08:00:19.000+0000" }, { "id": "422355", "author": { "name": "fahad86", "key": "fahad86", "displayName": "Muhammad Ahmed Fahad", "active": true, "timeZone": "Asia/Shanghai" }, "body": "I would suggest to revert or re-evaluate the changes on the files TiBaseActivity.java and KrollProxy.java in comparison to the 6_0_X branch", "updateAuthor": { "name": "fahad86", "key": "fahad86", "displayName": "Muhammad Ahmed Fahad", "active": true, "timeZone": "Asia/Shanghai" }, "created": "2017-06-20T09:53:11.000+0000", "updated": "2017-06-20T09:53:11.000+0000" }, { "id": "422435", "author": { "name": "fahad86", "key": "fahad86", "displayName": "Muhammad Ahmed Fahad", "active": true, "timeZone": "Asia/Shanghai" }, "body": "Anyone looking at these messages?? (-)", "updateAuthor": { "name": "fahad86", "key": "fahad86", "displayName": "Muhammad Ahmed Fahad", "active": true, "timeZone": "Asia/Shanghai" }, "created": "2017-06-21T02:04:53.000+0000", "updated": "2017-06-21T02:04:53.000+0000" }, { "id": "422471", "author": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~fahad86] We are looking into it, thanks for bringing this to attention.", "updateAuthor": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-06-21T16:14:45.000+0000", "updated": "2017-06-21T16:14:45.000+0000" } ], "maxResults": 14, "total": 14, "startAt": 0 } } }