{ "id": "159906", "key": "TIMOB-23333", "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": "16980", "description": "New V8", "name": "Release 6.0.0", "archived": false, "released": true, "releaseDate": "2016-11-15" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2016-06-07T14:44:04.000+0000", "created": "2016-04-29T20:24:48.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [], "versions": [ { "id": "17993", "description": "Release 5.2.2", "name": "Release 5.2.2", "archived": false, "released": true, "releaseDate": "2016-04-05" } ], "issuelinks": [], "assignee": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2018-08-06T17:49:33.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 get the following crash frequently:\r\n\r\njava.lang.RuntimeException: Unable to destroy activity {com.myapp/org.appcelerator.titanium.TiActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.view.OrientationEventListener.disable()' on a null object reference\r\nat android.app.ActivityThread.performDestroyActivity(ActivityThread.java:3821)\r\nat android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:3839)\r\nat android.app.ActivityThread.access$1400(ActivityThread.java:162)\r\nat android.app.ActivityThread$H.handleMessage(ActivityThread.java:1403)\r\nat android.os.Handler.dispatchMessage(Handler.java:102)\r\nat android.os.Looper.loop(Looper.java:135)\r\nat android.app.ActivityThread.main(ActivityThread.java:5431)\r\nat java.lang.reflect.Method.invoke(Native Method)\r\nat java.lang.reflect.Method.invoke(Method.java:372)\r\nat com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:914)\r\nat com.android.internal.os.ZygoteInit.main(ZygoteInit.java:707)\r\nCaused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.view.OrientationEventListener.disable()' on a null object reference\r\nat org.appcelerator.titanium.TiBaseActivity.onDestroy(TiBaseActivity.java:1477)\r\nat org.appcelerator.titanium.TiActivity.onDestroy(TiActivity.java:29)\r\nat android.app.Activity.performDestroy(Activity.java:6235)\r\nat android.app.Instrumentation.callActivityOnDestroy(Instrumentation.java:1141)\r\nat android.app.ActivityThread.performDestroyActivity(ActivityThread.java:3808)\r\n... 10 more\r\n\r\n It is happening when android os terminates app to save memory at onDestroy method. (This happens quite a lot since our users usually keep app open for long periods) This is not happening at 4.0 sdk (we got those after upgrading from 4.0 to 5.2.2)\r\n\r\nAfter searching changes history this change seems to have caused this behavior : \r\n\r\nhttps://github.com/appcelerator/titanium_mobile/commit/2b12ad61775920f8045e168ae678ce123dfa14b4 seems to have caused the issue\r\n", "attachment": [], "flagged": false, "summary": "Android: Attempt to invoke virtual method 'void android.view.OrientationEventListener.disable()' on a null object reference Crash", "creator": { "name": "peaceofmind7", "key": "peaceofmind7", "displayName": "john adamis", "active": true, "timeZone": "Europe/Helsinki" }, "subtasks": [], "reporter": { "name": "peaceofmind7", "key": "peaceofmind7", "displayName": "john adamis", "active": true, "timeZone": "Europe/Helsinki" }, "environment": "Android", "closedSprints": [ { "id": 641, "state": "closed", "name": "2016 Sprint 12 SDK", "startDate": "2016-06-04T00:30:28.612Z", "endDate": "2016-06-18T00:30:00.000Z", "completeDate": "2016-06-20T04:25:16.065Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "384813", "author": { "name": "nsalahin", "key": "nsalahin", "displayName": "Nazmus Salahin", "active": true, "timeZone": "Asia/Dhaka" }, "body": "Hello,\r\nThanks for reporting. It will be appreciated if you share simple test code that reproduces this issue. We will confirm the issue as bug when we are able to reproduce it.\r\n\r\nThanks in advance\r\n", "updateAuthor": { "name": "nsalahin", "key": "nsalahin", "displayName": "Nazmus Salahin", "active": true, "timeZone": "Asia/Dhaka" }, "created": "2016-05-05T05:38:03.000+0000", "updated": "2016-05-05T05:38:03.000+0000" }, { "id": "384861", "author": { "name": "soumyakantikar", "key": "soumyakantikar", "displayName": "Soumya Kanti Kar", "active": true, "timeZone": "America/Havana" }, "body": "Hi,\r\n\r\nWe are also getting the same issue. We have not tried it with older SDK version as we started the project development with 5.2.0.GA and then moved to 5.3.0.GA. But for the android version, we too get the same exception regularly.\r\n\r\n*Log*:\r\n\r\n============================\r\nD/InputDispatcher( 2888): Focused application set to: xxxx\r\nE/TiApplication(20815): (main) [460,1031] Sending event: exception on thread: main msg:java.lang.RuntimeException: Unable to destroy activity {com.labs.openapps/org.appcelerator.titanium.TiActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.view.OrientationEventListener.disable()' on a null object reference; Titanium 5.2.2,2016/03/28 14:12,b685ddb\r\nE/TiApplication(20815): java.lang.RuntimeException: Unable to destroy activity {com.labs.openapps/org.appcelerator.titanium.TiActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.view.OrientationEventListener.disable()' on a null object reference\r\nE/TiApplication(20815): \tat android.app.ActivityThread.performDestroyActivity(ActivityThread.java:4828)\r\nE/TiApplication(20815): \tat android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:4846)\r\nE/TiApplication(20815): \tat android.app.ActivityThread.access$1600(ActivityThread.java:197)\r\nE/TiApplication(20815): \tat android.app.ActivityThread$H.handleMessage(ActivityThread.java:1710)\r\nE/TiApplication(20815): \tat android.os.Handler.dispatchMessage(Handler.java:102)\r\nE/TiApplication(20815): \tat android.os.Looper.loop(Looper.java:145)\r\nE/TiApplication(20815): \tat android.app.ActivityThread.main(ActivityThread.java:6873)\r\nE/TiApplication(20815): \tat java.lang.reflect.Method.invoke(Native Method)\r\nE/TiApplication(20815): \tat java.lang.reflect.Method.invoke(Method.java:372)\r\nE/TiApplication(20815): \tat com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1404)\r\nE/TiApplication(20815): \tat com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1199)\r\nE/TiApplication(20815): Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.view.OrientationEventListener.disable()' on a null object reference\r\nE/TiApplication(20815): \tat org.appcelerator.titanium.TiBaseActivity.onDestroy(TiBaseActivity.java:1477)\r\nE/TiApplication(20815): \tat org.appcelerator.titanium.TiActivity.onDestroy(TiActivity.java:29)\r\nE/TiApplication(20815): \tat android.app.Activity.performDestroy(Activity.java:6784)\r\nE/TiApplication(20815): \tat android.app.Instrumentation.callActivityOnDestroy(Instrumentation.java:1155)\r\nE/TiApplication(20815): \tat android.app.ActivityThread.performDestroyActivity(ActivityThread.java:4806)\r\nE/TiApplication(20815): \t... 10 more\r\nW/ResourceType( 3205): No package identifier when getting value for resource number 0x00000000\r\nW/PackageManager( 3205): Failure retrieving resources for com.labs.openapps: Resource ID #0x0\r\n==============\r\n\r\n*Scenario*:\r\nAfter using the application for sometime, we press the home button. Then we continue to use other applications like YouTube, Browser and several other apps and press the home button to pause them. Then, when we launch our application again, it gets stuck in the splash screen. We found the following in the adb log.\r\n\r\nAs @john mentions, this is being triggered when the system is running low in memory and our application's onDestroy is being called where the issue is happening.", "updateAuthor": { "name": "soumyakantikar", "key": "soumyakantikar", "displayName": "Soumya Kanti Kar", "active": true, "timeZone": "America/Havana" }, "created": "2016-05-05T14:56:48.000+0000", "updated": "2016-05-05T15:00:01.000+0000" }, { "id": "384866", "author": { "name": "soumyakantikar", "key": "soumyakantikar", "displayName": "Soumya Kanti Kar", "active": true, "timeZone": "America/Havana" }, "body": "To add it, the change was included from 4_1_X (after going through GitHub). The older version of the application was built with 3.5.0.GA, where this issue is not observed. The object gets created in onCreate (orientationListener) but when inside onDestroy, it becomes null in some cases which results in the issue. This is becoming a block issue for the release of the application.", "updateAuthor": { "name": "soumyakantikar", "key": "soumyakantikar", "displayName": "Soumya Kanti Kar", "active": true, "timeZone": "America/Havana" }, "created": "2016-05-05T15:18:15.000+0000", "updated": "2016-05-05T15:18:15.000+0000" }, { "id": "384892", "author": { "name": "peaceofmind7", "key": "peaceofmind7", "displayName": "john adamis", "active": true, "timeZone": "Europe/Helsinki" }, "body": "This should occur with a basic appcelerator app, you can try kitchensink for example should have the same behavior.\r\n\r\nTo add on this, we have implemented our system to get informed with crashes sent automatically at google analytics at next app restart so i can give you the following stat :\r\n\r\nOur app has to be used for 8 hour shifts from emplyees which means noone closes app for a long time.\r\n\r\nYesterday out of 756 people we had 196 crashes so this is major.\r\n\r\nThis comes in many flavors depening device type (54 unique occurences in analytics)\r\n\r\nSometimes we get the one in description , some others this :\r\n\r\njava.lang.RuntimeException: Unable to destroy activity {com.myapp/org.appcelerator.titanium.TiActivity}: java.lang.NullPointerException at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:4095) at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:4128) at android.app.ActivityThread.access$1400(ActivityThread.java:156) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1408) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:157) at android.app.ActivityThread.main(ActivityThread.java:5883) 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:872) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:688) at dalvik.system.NativeStart.main(Native Method) Caused by: java.lang.NullPointerException at org.appcelerator.titanium.TiBaseActivity.onDestroy(TiBaseActivity.java:1477) at org.appcelerator.titanium.TiActivity.onDestroy(TiActivity.java:29) at android.app.Activity.performDestroy(Activity.java:5515) at android.app.Instrumentation.callActivityOnDestroy(Instrumentation.java:1146) at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:4078) ... 11 more\r\n\r\nAll other occurances are variations of these types with different line numbers.\r\n\r\nWe where forced to impelement a module to use a foreground service (since this is not available from applcelerator) giving our process higher priority just for this reason to prevent android from killing app. But the only thing this service does is displaying the notification \"myapp is active\" since a notification is required from android when using foreground services. It's a little dumb but was the only solution we had for this issue until this is resolved.", "updateAuthor": { "name": "peaceofmind7", "key": "peaceofmind7", "displayName": "john adamis", "active": true, "timeZone": "Europe/Helsinki" }, "created": "2016-05-05T19:16:58.000+0000", "updated": "2016-05-05T19:56:15.000+0000" }, { "id": "384911", "author": { "name": "soumyakantikar", "key": "soumyakantikar", "displayName": "Soumya Kanti Kar", "active": true, "timeZone": "America/Havana" }, "body": "Hi,\r\n\r\nThe easiest way to test this scenario is as following:\r\n\r\n*Test Case*:\r\n1. Launch Settings\r\n2. Developer Options\r\n3. Enable >> Do not keep activities\r\n4. Limit background processes >> No background processes\r\n\r\nNow you need to launch the application generated using Appcelerator 5.2.2.GA, then switch over to a different application (say YouTube). Now when you close YouTube, in the adb log you will observe the crash log. with the same stack trace. If we execute the same test case for application generated using 3.5.0.GA, then it does not generate the crash.", "updateAuthor": { "name": "soumyakantikar", "key": "soumyakantikar", "displayName": "Soumya Kanti Kar", "active": true, "timeZone": "America/Havana" }, "created": "2016-05-05T21:20:05.000+0000", "updated": "2016-05-05T21:20:28.000+0000" }, { "id": "386533", "author": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I tried Enabling \"Do not keep activities\" and Limit background processes to 0, unable to reproduce this on 4.x and 6.x devices. Do you have a concrete test case to reproduce this? I tested on both 5.2.2 and master. Thank.\r\n\r\nThough based on the error, it looks like orientationListener object is null. Please try this PR and see if it fixes the issue: https://github.com/appcelerator/titanium_mobile/pull/8014.", "updateAuthor": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-05-23T21:40:35.000+0000", "updated": "2016-05-23T21:44:52.000+0000" }, { "id": "386537", "author": { "name": "soumyakantikar", "key": "soumyakantikar", "displayName": "Soumya Kanti Kar", "active": true, "timeZone": "America/Havana" }, "body": "Build KitchenSink with 5.2.2.GA. Launch the application on Android 4.4 device (Samsung Galaxy). Go to base UI, launch Window Layout. Press the home key. Launch app again. (It tries to launch and then closes).\r\n\r\nIn the development settings keep no background process and disable the option do not keep activities.", "updateAuthor": { "name": "soumyakantikar", "key": "soumyakantikar", "displayName": "Soumya Kanti Kar", "active": true, "timeZone": "America/Havana" }, "created": "2016-05-23T21:58:22.000+0000", "updated": "2016-05-23T21:58:22.000+0000" }, { "id": "386658", "author": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I've done that and unable to reproduce it. Can you test it with the PR above to see if it fixes your problem? Thanks", "updateAuthor": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-05-24T18:36:15.000+0000", "updated": "2016-05-24T18:36:15.000+0000" }, { "id": "395971", "author": { "name": "dfoxinator", "key": "dfoxinator", "displayName": "David Fox", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Why wasn't this fix added to 5.x? This is a major bug, by far the most frequently reported crash for my app, and I would assume for many other apps too. So to fix it we have to compile from the source and add the fix ourselves? I'm curious what the logic was for not applying this fix to 5.x.", "updateAuthor": { "name": "dfoxinator", "key": "dfoxinator", "displayName": "David Fox", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-09-13T02:27:31.000+0000", "updated": "2016-09-13T02:27:31.000+0000" }, { "id": "396205", "author": { "name": "nomorhop", "key": "nomorhop", "displayName": "Morten Hopstad", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I agree with David Fox. Im having this issue aswell on my rather large app.\r\n\r\nThough, this ticket status is set to resolved so I dont know if anyone reads it.", "updateAuthor": { "name": "nomorhop", "key": "nomorhop", "displayName": "Morten Hopstad", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-09-15T10:13:41.000+0000", "updated": "2016-09-15T10:13:41.000+0000" }, { "id": "396233", "author": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "body": "I'm sorry but 5.5.0 is really focused on iOS10 support only. As we are working to improve our quality in our releases, we won't rush to have solutions into our version releases. 6.0.0 is not too far away either. :)", "updateAuthor": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2016-09-15T16:28:26.000+0000", "updated": "2016-09-15T16:28:26.000+0000" }, { "id": "400465", "author": { "name": "ulizama", "key": "ulizama", "displayName": "Uriel Lizama", "active": true, "timeZone": "America/Mexico_City" }, "body": "Is the fix to this issue going to be added on the 6.0.0 release?", "updateAuthor": { "name": "ulizama", "key": "ulizama", "displayName": "Uriel Lizama", "active": true, "timeZone": "America/Mexico_City" }, "created": "2016-11-06T16:17:18.000+0000", "updated": "2016-11-06T16:17:18.000+0000" }, { "id": "400466", "author": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "body": "It was merged in 6.0 in June so you could try out the 6.0.0.RC (https://www.appcelerator.com/blog/2016/11/rc-releases-for-6-0-0-of-sdk-cli-4-8-0-of-studio/) to check if its working correctly now", "updateAuthor": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-11-06T17:17:45.000+0000", "updated": "2016-11-06T17:17:45.000+0000" }, { "id": "401807", "author": { "name": "nomorhop", "key": "nomorhop", "displayName": "Morten Hopstad", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I'm still having this problem. Anyone else? It seems to only occour on Nexus 6P", "updateAuthor": { "name": "nomorhop", "key": "nomorhop", "displayName": "Morten Hopstad", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-11-24T12:10:45.000+0000", "updated": "2016-11-24T12:10:45.000+0000" }, { "id": "440217", "author": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Cleaning up older fixed issues. If this issue should not have been closed as fixed, please reopen.", "updateAuthor": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-08-06T17:49:33.000+0000", "updated": "2018-08-06T17:49:33.000+0000" } ], "maxResults": 15, "total": 15, "startAt": 0 } } }