{ "id": "168961", "key": "TIMOB-24962", "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": "19870", "description": "", "name": "Release 6.1.2", "archived": false, "released": true, "releaseDate": "2017-08-03" } ], "resolution": { "id": "3", "description": "The problem is a duplicate of an existing issue.", "name": "Duplicate" }, "resolutiondate": "2017-07-26T19:06:13.000+0000", "created": "2017-07-14T15:23:12.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [ "android", "crash", "defect" ], "versions": [ { "id": "19333", "description": "Patch release for important items that did not make it into 6.0.3", "name": "Release 6.0.4", "archived": false, "released": true, "releaseDate": "2017-04-27" }, { "id": "19572", "description": "Important fixes for 6.1.0", "name": "Release 6.1.1", "archived": false, "released": true, "releaseDate": "2017-06-16" } ], "issuelinks": [ { "id": "55482", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "167807", "key": "TIMOB-24710", "fields": { "summary": "Android: V8 crashes on Android N", "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 } } } }, { "id": "55481", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "165091", "key": "TIMOB-24265", "fields": { "summary": "Android: Application can't recover from storage permission change", "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": "Medium", "id": "3" }, "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-07-27T15:57:19.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": "When resuming the app from background the app crashes most of the times on device SM-G928G. \r\n\r\nTo replicate this install the default app when creating a new project (also attached) on the android device. \r\n\r\nTo trigger the app to go to background go to developer settings and put the option \"limit background process\" to \"at most 1 process\". \r\n\r\nOpen the just installed app, go through multitasking to another app, then again through multitasking go back to the just installed app. The app will now crash.\r\n\r\nA log we found around the crash:\r\n\r\n{code}\r\n07-14 15:59:56.166 21434-21434/? E/Zygote: v2\r\n07-14 15:59:56.167 21434-21434/? E/Zygote: accessInfo : 0\r\n07-14 15:59:56.167 21434-21434/? W/SELinux: SELinux selinux_android_compute_policy_index : Policy Index[2], Con:u:r:zygote:s0 RAM:SEPF_SECMOBILE_7.0_0005, [-1 -1 -1 -1 0 1]\r\n07-14 15:59:56.197 3642-3666/? W/WindowManager: Failed looking up window\r\n java.lang.IllegalArgumentException: Requested window android.view.ViewRootImpl$W@c68471b does not exist\r\n at com.android.server.wm.WindowManagerService.windowForClientLocked(WindowManagerService.java:10431)\r\n at com.android.server.wm.WindowManagerService.windowForClientLocked(WindowManagerService.java:10422)\r\n at com.android.server.wm.WindowManagerService.removeWindow(WindowManagerService.java:2674)\r\n at com.android.server.wm.Session.remove(Session.java:208)\r\n at android.view.ViewRootImpl.dispatchDetachedFromWindow(ViewRootImpl.java:3699)\r\n at android.view.ViewRootImpl.doDie(ViewRootImpl.java:6612)\r\n at android.view.ViewRootImpl$ViewRootHandler.handleMessage(ViewRootImpl.java:4117)\r\n at android.os.Handler.dispatchMessage(Handler.java:102)\r\n at android.os.Looper.loop(Looper.java:154)\r\n at android.os.HandlerThread.run(HandlerThread.java:61)\r\n at com.android.server.ServiceThread.run(ServiceThread.java:46)\r\n07-14 15:59:56.202 21434-21434/? W/System: ClassLoader referenced unknown path: /system/priv-app/CMHProvider/lib/arm64\r\n{code}", "attachment": [ { "id": "62886", "filename": "Crash on Resume.zip", "author": { "name": "topener", "key": "topener", "displayName": "Rene Pot", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-07-14T15:20:06.000+0000", "size": 7870176, "mimeType": "application/zip" } ], "flagged": false, "summary": "Android - App Crashes on Resume ", "creator": { "name": "topener", "key": "topener", "displayName": "Rene Pot", "active": true, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "topener", "key": "topener", "displayName": "Rene Pot", "active": true, "timeZone": "Europe/Berlin" }, "environment": "Device: SM-G928G\r\nAndroid 7.0\r\nTiSDK 6.1.1.GA and 6.0.3.GA", "closedSprints": [ { "id": 925, "state": "closed", "name": "2017 Sprint 15 SDK", "startDate": "2017-07-16T14:40:47.191Z", "endDate": "2017-07-30T14:40:00.000Z", "completeDate": "2017-07-31T16:15:09.335Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "424147", "author": { "name": "topener", "key": "topener", "displayName": "Rene Pot", "active": true, "timeZone": "Europe/Berlin" }, "body": "I should add it doesn't only happen on device specified, but I know for certain it does happen on that one.", "updateAuthor": { "name": "topener", "key": "topener", "displayName": "Rene Pot", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-07-14T15:40:35.000+0000", "updated": "2017-07-14T15:40:35.000+0000" }, { "id": "424228", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Setting the \"limit background process\" to 1 will force quit apps that were put in the background (ie: suspended). This is normal. You can tell when this is happening when you see \"WINDEATH\" in the Android log. You can see the full log via the Android SDK's \"adb logcat\" command line tool.\r\n\r\nYou can see this happening with Google's apps as well. Tap on the Calendar app and then create/tap on an event to display an event activity window. Press the home button and go to a different app. And then switch back to the Calendar app. Notice that the Calendar app is restarting (you can see its splashscreen). You would also see that it was forced-quit by the Android OS in the background as well (WINDEATH in adb logcat). The difference here is that Google's app keeps track of the last state it was in so that it can restore its previous state.\r\n\r\nAlso, the Android OS can force-quit your app when it is running low on memory as well. This is likely to happen if your app consumes a lot of memory such as images.", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-07-17T16:16:11.000+0000", "updated": "2017-07-17T16:16:11.000+0000" }, { "id": "424232", "author": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "updateAuthor": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-07-17T18:15:05.000+0000", "updated": "2017-07-17T18:15:05.000+0000" }, { "id": "424267", "author": { "name": "caioiglesias88", "key": "caioiglesias88", "displayName": "Caio Iglesias", "active": true, "timeZone": "Europe/Amsterdam" }, "body": "Hi, I work with Rene and I saw this issue happening too. Setting the limit of background processes to 1 is just the quick way to create the scenario for the crash to occur faster.\r\n\r\nI used Joshua's calendar example for this video:\r\nhttps://drive.google.com/file/d/0B4q2Tzi3o3rydGtla2ZrbTVOQjQ/view\r\n\r\nGoogle calendar relaunches, Titanium based app attempts to relaunch and then crashes.", "updateAuthor": { "name": "caioiglesias88", "key": "caioiglesias88", "displayName": "Caio Iglesias", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2017-07-18T09:15:48.000+0000", "updated": "2017-07-18T09:15:48.000+0000" }, { "id": "424278", "author": { "name": "topener", "key": "topener", "displayName": "Rene Pot", "active": true, "timeZone": "Europe/Berlin" }, "body": "It indeed seems to have relation with the crash mentioned above. To me this issue seems quite urgent as we get floaded with crashreports in the vitals dashboard and through other channels. ", "updateAuthor": { "name": "topener", "key": "topener", "displayName": "Rene Pot", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-07-18T12:23:49.000+0000", "updated": "2017-07-18T12:23:49.000+0000" }, { "id": "424325", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "It's not crashing on resume. It's being force quit in the background after switching apps. That's my point.\r\n\r\nFor example, try adding this code snippet to your app:\r\n\r\n{code:javascript}\r\nsetInterval(function() {\r\n\tTi.API.info(\"@@@ Timer elapsed. \" + (new Date()).toString());\r\n}, 1000);\r\n{code}\r\n\r\nThe above will log a message every 1 second, even while the app is in the background (this isn't iOS; your app doesn't really suspend). When switching to another app with this setting on (or if the device is running low on memory), your app can be force-quit by the OS. When this happens, you'll notice that the above stops logging a message every 1 second and the last logged message will be followed by another message such as...\r\n\r\n{code}\r\nActivityManager: Killing :\r\n{code}\r\n\r\n...along with a message like this...\r\n\r\n{code}\r\nWindowManager: WIN DEATH: Window{228b981 u0 /.}\r\n{code}\r\n\r\nYou can't catch this event. This is like a Windows Ctrl+Alt+Delete equivalent that's happening to your app. And unfortunately, Android won't automatically restore the last state of your app. It's up to you keep track of where it was last left off.\r\n\r\nAlso, I don't think the \"IllegalArgumentException\" stack trace you gave us is related. We actually see this exception when launching an app from a \"cold start\" from Appcelerator Studio. And it's an exception from the OS, not the Titanium app. Note that there is no Titanium/Appcelerator related things in the stack trace (although I'd like to know what triggers this).", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-07-18T21:04:35.000+0000", "updated": "2017-07-18T21:04:35.000+0000" }, { "id": "424774", "author": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "body": "This will be fixed by https://github.com/appcelerator/titanium_mobile/pull/9256", "updateAuthor": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-07-26T11:49:18.000+0000", "updated": "2017-07-26T11:49:18.000+0000" }, { "id": "424830", "author": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Resolving as duplicate of TIMOB-24710\r\n\r\nThis issue has been addressed in 6_1_X by [PR-#9256|https://github.com/appcelerator/titanium_mobile/pull/9256]", "updateAuthor": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-07-26T19:06:13.000+0000", "updated": "2017-07-26T19:06:28.000+0000" }, { "id": "424832", "author": { "name": "amukherjee", "key": "amukherjee", "displayName": "Abir Mukherjee", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Closing this as TIMOB-24710 is confirmed to have the fix.", "updateAuthor": { "name": "amukherjee", "key": "amukherjee", "displayName": "Abir Mukherjee", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-07-26T20:10:51.000+0000", "updated": "2017-07-26T20:10:51.000+0000" }, { "id": "424869", "author": { "name": "caioiglesias88", "key": "caioiglesias88", "displayName": "Caio Iglesias", "active": true, "timeZone": "Europe/Amsterdam" }, "body": "Cool! Just tested it with the PR too. Works! Nice job!", "updateAuthor": { "name": "caioiglesias88", "key": "caioiglesias88", "displayName": "Caio Iglesias", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2017-07-27T08:25:56.000+0000", "updated": "2017-07-27T08:25:56.000+0000" }, { "id": "424966", "author": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "body": "While this is working fine on my Android 7 device (HTC A9) I have problems with the default Alloy app on a Moto G2 (5.1.1):\r\n[Video|http://migaweb.de/restart2.mp4]\r\nApp background limit is set to 1, so after starting the Play Store the test_start2 app is destroyed in the background.\r\n\r\nHere is the log:\r\n\r\n{code:java}\r\nI/TiApplication(12729): (main) [0,0] checkpoint, app created.\r\nI/TiApplication(12729): (main) [105,105] Titanium 6.1.2 (2017/07/27 01:49 undefined)\r\nE/Vold(319): Failed to find mounted volume for /storage/sdcard1/Android/data/com.miga.test2/cache/\r\nW/Vold(319): Returning OperationFailed - no handler for errno 0\r\nI/TiApplication(12729): (main) [778,883] Titanium Javascript runtime: v8\r\nW/TiBaseActivity(12729): (main) [20,903] Runtime has been disposed or app has been killed. Finishing.\r\nW/TiApplication(12729): (main) [11,914] Scheduling application restart\r\nD/TiLaunchActivity(12729): (main) [149,1063] willFinishFalseRootActivity: TiApplication.forceFinishRoot = true\r\nW/InputMethodManagerService(921): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@24c68dbf attribute=null, token = android.os.BinderProxy@235129e5\r\nW/libprocessgroup(921): failed to open /acct/uid_10214/pid_12729/cgroup.procs: No such file or directory\r\nV/WindowManager(921): removeAppToken make exiting: AppWindowToken{d7a672 token=Token{bb8f77d ActivityRecord{36f609d4 u0 com.miga.test2/org.appcelerator.titanium.TiActivity t993}}}\r\nW/WindowManager(921): Failed looking up window\r\nW/WindowManager(921): java.lang.IllegalArgumentException: Requested window android.view.ViewRootImpl$W@52c1492 does not exist\r\nW/WindowManager(921): \tat com.android.server.wm.WindowManagerService.windowForClientLocked(WindowManagerService.java:8464)\r\nW/WindowManager(921): \tat com.android.server.wm.WindowManagerService.windowForClientLocked(WindowManagerService.java:8455)\r\nW/WindowManager(921): \tat com.android.server.wm.WindowManagerService.removeWindow(WindowManagerService.java:2575)\r\nW/WindowManager(921): \tat com.android.server.wm.Session.remove(Session.java:186)\r\nW/WindowManager(921): \tat android.view.ViewRootImpl.dispatchDetachedFromWindow(ViewRootImpl.java:2959)\r\nW/WindowManager(921): \tat android.view.ViewRootImpl.doDie(ViewRootImpl.java:5460)\r\nW/WindowManager(921): \tat android.view.ViewRootImpl$ViewRootHandler.handleMessage(ViewRootImpl.java:3283)\r\nW/WindowManager(921): \tat android.os.Handler.dispatchMessage(Handler.java:102)\r\nW/WindowManager(921): \tat android.os.Looper.loop(Looper.java:135)\r\nW/WindowManager(921): \tat android.os.HandlerThread.run(HandlerThread.java:61)\r\nW/WindowManager(921): \tat com.android.server.ServiceThread.run(ServiceThread.java:46)\r\n{code}\r\n\r\nA different (more complex) app restarts fine on the HTC device! Just the default currently makes problems on the old device.", "updateAuthor": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-07-27T15:57:19.000+0000", "updated": "2017-07-27T15:57:19.000+0000" } ], "maxResults": 12, "total": 12, "startAt": 0 } } }