{ "id": "122458", "key": "TIMOB-15872", "fields": { "issuetype": { "id": "7", "description": "gh.issue.story.desc", "name": "Story", "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": [], "resolution": { "id": "8", "description": "", "name": "Needs more info" }, "resolutiondate": "2014-09-02T22:15:54.000+0000", "created": "2013-11-14T10:45:24.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "look1", "triage" ], "versions": [], "issuelinks": [], "assignee": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2018-08-06T17:43:14.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": "h4. Problem\r\n\r\nGoogle Play Crash reports contain multiple of the following NullPointerExceptions occuring at the same place:\r\n\r\n{code}\r\njava.lang.NullPointerException\r\nat android.view.ViewConfiguration.get(ViewConfiguration.java:228)\r\nat android.view.View.(View.java:1888)\r\nat android.view.ViewGroup.(ViewGroup.java:281)\r\nat android.widget.FrameLayout.(FrameLayout.java:80)\r\nat ti.modules.titanium.ui.widget.tableview.TiTableView.(TiTableView.java:266)\r\nat ti.modules.titanium.ui.widget.TiUITableView.processProperties(TiUITableView.java:106)\r\nat org.appcelerator.kroll.KrollProxy.setModelListener(KrollProxy.java:1129)\r\nat org.appcelerator.titanium.proxy.TiViewProxy.realizeViews(TiViewProxy.java:469)\r\nat org.appcelerator.titanium.proxy.TiViewProxy.handleGetView(TiViewProxy.java:460)\r\nat org.appcelerator.titanium.proxy.TiViewProxy.getOrCreateView(TiViewProxy.java:438)\r\nat ti.modules.titanium.ui.TableViewProxy.getTableView(TableViewProxy.java:146)\r\nat ti.modules.titanium.ui.TableViewProxy.handleSetData(TableViewProxy.java:689)\r\nat ti.modules.titanium.ui.TableViewProxy.handleMessage(TableViewProxy.java:866)\r\nat android.os.Handler.dispatchMessage(Handler.java:95)\r\nat android.os.Looper.loop(Looper.java:130)\r\nat android.app.ActivityThread.main(ActivityThread.java:3691)\r\nat java.lang.reflect.Method.invokeNative(Native Method)\r\nat java.lang.reflect.Method.invoke(Method.java:507)\r\nat com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:907)\r\nat com.android.internal.os.ZygoteInit.main(ZygoteInit.java:665)\r\nat dalvik.system.NativeStart.main(Native Method)\r\n{code}\r\n\r\n{code}\r\nCaused by: java.lang.NullPointerException\r\nat android.view.ViewConfiguration.get(ViewConfiguration.java:230)\r\nat android.view.View.(View.java:1920)\r\nat android.view.ViewGroup.(ViewGroup.java:303)\r\nat android.widget.FrameLayout.(FrameLayout.java:80)\r\nat ti.modules.titanium.ui.widget.tableview.TiTableView.(TiTableView.java:266)\r\nat ti.modules.titanium.ui.widget.TiUITableView.processProperties(TiUITableView.java:106)\r\nat org.appcelerator.kroll.KrollProxy.setModelListener(KrollProxy.java:1129)\r\nat org.appcelerator.titanium.proxy.TiViewProxy.realizeViews(TiViewProxy.java:469)\r\nat org.appcelerator.titanium.proxy.TiViewProxy.handleGetView(TiViewProxy.java:460)\r\nat org.appcelerator.titanium.proxy.TiViewProxy.getOrCreateView(TiViewProxy.java:438)\r\nat ti.modules.titanium.ui.TableViewProxy.getTableView(TableViewProxy.java:146)\r\nat ti.modules.titanium.ui.TableViewProxy.handleSetData(TableViewProxy.java:689)\r\nat ti.modules.titanium.ui.TableViewProxy.handleMessage(TableViewProxy.java:866)\r\nat android.os.Handler.dispatchMessage(Handler.java:95)\r\nat org.appcelerator.kroll.common.TiMessenger.dispatchMessage(TiMessenger.java:364)\r\nat org.appcelerator.kroll.common.TiMessenger.dispatchPendingMessages(TiMessenger.java:349)\r\nat org.appcelerator.kroll.common.TiMessenger$2.getResult(TiMessenger.java:234)\r\nat org.appcelerator.kroll.common.TiMessenger.sendBlockingMessage(TiMessenger.java:261)\r\nat org.appcelerator.kroll.common.TiMessenger.sendBlockingRuntimeMessage(TiMessenger.java:186)\r\nat org.appcelerator.kroll.KrollProxy.fireSyncEvent(KrollProxy.java:740)\r\nat org.appcelerator.titanium.TiBaseActivity.onStop(TiBaseActivity.java:1058)\r\nat org.appcelerator.titanium.TiLaunchActivity.onStop(TiLaunchActivity.java:355)\r\nat android.app.Instrumentation.callActivityOnStop(Instrumentation.java:1272)\r\nat android.app.Activity.performStop(Activity.java:4073)\r\nat android.app.ActivityThread.performDestroyActivity(ActivityThread.java:3127)\r\n... 11 more\r\n{code}\r\n\r\n{code}\r\nCaused by: java.lang.NullPointerException\r\nat android.view.ViewConfiguration.get(ViewConfiguration.java:228)\r\nat android.view.View.(View.java:1878)\r\nat android.view.ViewGroup.(ViewGroup.java:281)\r\nat android.widget.FrameLayout.(FrameLayout.java:80)\r\nat ti.modules.titanium.ui.widget.tableview.TiTableView.(TiTableView.java:266)\r\nat ti.modules.titanium.ui.widget.TiUITableView.processProperties(TiUITableView.java:106)\r\nat org.appcelerator.kroll.KrollProxy.setModelListener(KrollProxy.java:1129)\r\nat org.appcelerator.titanium.proxy.TiViewProxy.realizeViews(TiViewProxy.java:469)\r\nat org.appcelerator.titanium.proxy.TiViewProxy.handleGetView(TiViewProxy.java:460)\r\nat org.appcelerator.titanium.proxy.TiViewProxy.getOrCreateView(TiViewProxy.java:438)\r\nat ti.modules.titanium.ui.TableViewProxy.getTableView(TableViewProxy.java:146)\r\nat ti.modules.titanium.ui.TableViewProxy.handleSetData(TableViewProxy.java:689)\r\nat ti.modules.titanium.ui.TableViewProxy.handleMessage(TableViewProxy.java:866)\r\nat android.os.Handler.dispatchMessage(Handler.java:95)\r\nat org.appcelerator.kroll.common.TiMessenger.dispatchMessage(TiMessenger.java:364)\r\nat org.appcelerator.kroll.common.TiMessenger.dispatchPendingMessages(TiMessenger.java:349)\r\nat org.appcelerator.kroll.common.TiMessenger$2.getResult(TiMessenger.java:234)\r\nat org.appcelerator.kroll.common.TiMessenger.sendBlockingMessage(TiMessenger.java:261)\r\nat org.appcelerator.kroll.common.TiMessenger.sendBlockingRuntimeMessage(TiMessenger.java:186)\r\nat org.appcelerator.kroll.KrollProxy.fireSyncEvent(KrollProxy.java:740)\r\nat org.appcelerator.titanium.TiBaseActivity.onPause(TiBaseActivity.java:917)\r\nat org.appcelerator.titanium.TiLaunchActivity.onPause(TiLaunchActivity.java:339)\r\nat android.app.Activity.performPause(Activity.java:3851)\r\nat android.app.Instrumentation.callActivityOnPause(Instrumentation.java:1191)\r\nat android.app.ActivityThread.performPauseActivity(ActivityThread.java:2345)\r\n... 12 more\r\n{code}\r\n\r\nh4. Test Case\r\nUnfortunately, I haven't been able to find steps to reproduce this issue. The best way to go forward in my opinion is to analyze the code and to try and figure out from there, what is going wrong.\r\n\r\nh4. My Analysis\r\nFrom the code I see, that in the TiTableViewConstructor a call to \"super(proxy.getActivity())\" is done. In \"proxy.getActivity()\" it is noted, that this may return \"null\". I assume that this would lead to the crash reports above.\r\n\r\nCould it be that we have a possible race condition or something similar here, where \"proxy.getActivity()\" is called, before the proxy actually has an activity assigned to it?\r\n\r\nIs anyone else seeing this problem on a large installation base?\r\n\r\nIt would be great to improve the stability of Titanium further by fixing this issue.", "attachment": [], "flagged": false, "summary": "Android: NPE at android.view.ViewConfiguration.get()", "creator": { "name": "philet", "key": "philet", "displayName": "Philippe Wueger", "active": true, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "philet", "key": "philet", "displayName": "Philippe Wueger", "active": true, "timeZone": "Europe/Berlin" }, "environment": "Ti SDK 3.1.3\r\nAndroid\r\nVarious devices (according to Google Play): Desire HD (ace), Galaxy S II (GT-I9100), Xperia T (LT30p) ", "closedSprints": [ { "id": 199, "state": "closed", "name": "2014 Sprint 18 SDK", "startDate": "2014-09-02T22:56:57.421Z", "endDate": "2014-09-13T00:00:00.000Z", "completeDate": "2014-09-15T20:08:19.146Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "282908", "author": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Hi Philippe,\n\n You're correct. Based on the log, this is looking like a timing issue. However, without a proper test case, we can't continue to investigate since timing issues are usually edge cases.", "updateAuthor": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-12-06T17:59:54.000+0000", "updated": "2013-12-06T17:59:54.000+0000" }, { "id": "284550", "author": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "body": "We unfortunately can't proceed any further without some form of test case. We'll be happy to revisit this once we have a better set of steps.", "updateAuthor": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-12-16T21:13:03.000+0000", "updated": "2013-12-16T21:13:03.000+0000" }, { "id": "289030", "author": { "name": "thewarpedcoder", "key": "thewarpedcoder", "displayName": "Trevor Ward", "active": true, "timeZone": "Europe/London" }, "body": "We have hit this issue, I will try and get a use case in place\r\n", "updateAuthor": { "name": "thewarpedcoder", "key": "thewarpedcoder", "displayName": "Trevor Ward", "active": true, "timeZone": "Europe/London" }, "created": "2014-01-21T15:56:08.000+0000", "updated": "2014-01-21T15:56:08.000+0000" }, { "id": "306179", "author": { "name": "noahlively", "key": "noahlively", "displayName": "Noah Lively", "active": true, "timeZone": "America/Los_Angeles" }, "body": "We are having the same problem. My stats are:\r\n- Titanium SDK 3.2.2 GA\r\n- Compiled and run on a Google Nexus 7 (2013 model)\r\n- App built in Alloy\r\n\r\nThe error happens inconsistently. Is there some way I can debug? It happens beneath the JS layer where Titanium allows me to debug, so no amount of breakpoints are helping me. I know enough Java to where, given the right debug framework, I could probably find out what's happening. Please advise. ", "updateAuthor": { "name": "noahlively", "key": "noahlively", "displayName": "Noah Lively", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-05-23T00:33:34.000+0000", "updated": "2014-05-23T00:33:34.000+0000" }, { "id": "317945", "author": { "name": "mfogg", "key": "mfogg", "displayName": "Mike Fogg", "active": true, "timeZone": "America/New_York" }, "body": "I am seeing this issue as well (Titanium 3.3.0, tons of different phones, and anything from Android 4.0 to 4.4.4).\r\n\r\nAfter taking a look at the various lines being reported (most likely due to the different versions of Android and other Android customizations done by providers) it seems to me that the error is coming from:\r\n\r\n{code:title=ViewConfiguration.java|borderStyle=solid}\r\n...\r\nfinal DisplayMetrics metrics = context.getResources().getDisplayMetrics();\r\n...\r\n{code}\r\n\r\n(https://github.com/android/platform_frameworks_base/blob/kitkat-mr2.2-release/core/java/android/view/ViewConfiguration.java#L352).\r\n\r\nIt looks pretty clear to me that 'context' is probably null. Does anyone have any tips as to how to figure out what \"context\" is actually referring to here? Aka, which view is null? I'm grasping at straws here as breadcrumbs make it pretty clear that people are crashing on any one the tableviews in the app.\r\n\r\nI'm having a difficult time reproducing this as well but it seems to be happening a lot (unless I try to reproduce it :) ).", "updateAuthor": { "name": "mfogg", "key": "mfogg", "displayName": "Mike Fogg", "active": true, "timeZone": "America/New_York" }, "created": "2014-08-11T13:27:47.000+0000", "updated": "2014-08-11T13:28:07.000+0000" }, { "id": "318154", "author": { "name": "philet", "key": "philet", "displayName": "Philippe Wueger", "active": true, "timeZone": "Europe/Berlin" }, "body": "I also think that this problem is occurring because of a 'null' context.\r\nMy current guess is, that this happens when the app is shutting down (no activity/context anymore) and for some reason there is still code run which instantiates UI objects (which would need an activity/context).\r\nI haven't yet managed to find a test case which reproduces this issue reliably.", "updateAuthor": { "name": "philet", "key": "philet", "displayName": "Philippe Wueger", "active": true, "timeZone": "Europe/Berlin" }, "created": "2014-08-12T06:47:41.000+0000", "updated": "2014-08-12T06:47:41.000+0000" }, { "id": "320201", "author": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~hpham] to investigate.", "updateAuthor": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-08-25T21:13:41.000+0000", "updated": "2014-08-25T21:13:41.000+0000" }, { "id": "321460", "author": { "name": "ayeung", "key": "ayeung", "displayName": "Allen Yeung", "active": true, "timeZone": "America/Los_Angeles" }, "body": "We need a concrete test case to be able to fully diagnose the issue here.", "updateAuthor": { "name": "ayeung", "key": "ayeung", "displayName": "Allen Yeung", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-09-02T22:15:55.000+0000", "updated": "2014-09-02T22:15:55.000+0000" }, { "id": "348800", "author": { "name": "jpriebe", "key": "jpriebe", "displayName": "Jason Priebe", "active": true, "timeZone": "America/New_York" }, "body": "This is one of our biggest crash issues on android as well. We have about 100,000 installs. It is too intermittent to reproduce, but happening much more than we would like in the wild. I don't know if we can build a test case for it, but I wish Appcelerator would take these seriously enough to investigate without a user-supplied test case.", "updateAuthor": { "name": "jpriebe", "key": "jpriebe", "displayName": "Jason Priebe", "active": true, "timeZone": "America/New_York" }, "created": "2015-04-07T18:17:42.000+0000", "updated": "2015-04-07T18:17:42.000+0000" }, { "id": "352319", "author": { "name": "athorne", "key": "athorne", "displayName": "Alex Bernier", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I also see a lot of crash reports for this issue. I just emailed ~50 of the users who got the crash to see if they remember what they were doing. I'll report back if I get any clues.", "updateAuthor": { "name": "athorne", "key": "athorne", "displayName": "Alex Bernier", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2015-05-12T20:04:43.000+0000", "updated": "2015-05-12T20:04:43.000+0000" }, { "id": "352345", "author": { "name": "ybrown", "key": "ybrown", "displayName": "Yishai Brown", "active": true, "timeZone": "Asia/Jerusalem" }, "body": "Just got similar crash report from NewRelic on Galaxy S (GT-I9000) Android 4.4.2 (df752133aa).\r\nThe app compiled with SDK 3.4.1\r\nAccording to the stack, it is upon construction of a TableView.\r\n\r\nandroid.view\tViewConfiguration.java line 313 in ViewConfiguration.get()\r\nandroid.view\tView.java line 3455 in View.()\r\nandroid.view\tViewGroup.java line 459 in ViewGroup.()\r\nandroid.widget\t FrameLayout.java line 93 in FrameLayout.()\r\nti.modules.titanium.ui.widget.tableview\tTiTableView.java line 274 in TiTableView.()\r\nti.modules.titanium.ui.widget\tTiUITableView.java line 106 in TiUITableView.processProperties()", "updateAuthor": { "name": "ybrown", "key": "ybrown", "displayName": "Yishai Brown", "active": true, "timeZone": "Asia/Jerusalem" }, "created": "2015-05-12T22:32:00.000+0000", "updated": "2015-05-12T22:32:00.000+0000" }, { "id": "356105", "author": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Can anyone point me to an app where this occurs? I'd be happy to tray and make some headway on this ticket if we had a app to try. Sounds like many of you have publicly available apps where this occurs. Let me know the name of one or more and we can try to reproduce.", "updateAuthor": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2015-06-26T20:33:05.000+0000", "updated": "2015-06-26T20:33:05.000+0000" }, { "id": "356118", "author": { "name": "athorne", "key": "athorne", "displayName": "Alex Bernier", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[TwoGrand|https://play.google.com/store/apps/details?id=com.twogrand.twogrand] has it, but we don't yet have steps to reproduce.", "updateAuthor": { "name": "athorne", "key": "athorne", "displayName": "Alex Bernier", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2015-06-26T21:25:14.000+0000", "updated": "2015-06-26T21:25:14.000+0000" }, { "id": "356126", "author": { "name": "jpriebe", "key": "jpriebe", "displayName": "Jason Priebe", "active": true, "timeZone": "America/New_York" }, "body": "WRAL News has it. You're more than welcome to look in our dashboard and look at APM info.", "updateAuthor": { "name": "jpriebe", "key": "jpriebe", "displayName": "Jason Priebe", "active": true, "timeZone": "America/New_York" }, "created": "2015-06-26T21:57:02.000+0000", "updated": "2015-06-26T21:57:02.000+0000" }, { "id": "397174", "author": { "name": "dfoxinator", "key": "dfoxinator", "displayName": "David Fox", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Did anyone ever figure this out? I'm seeing the same error in my app and it seems to be very difficult to reproduce.", "updateAuthor": { "name": "dfoxinator", "key": "dfoxinator", "displayName": "David Fox", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-09-25T00:22:10.000+0000", "updated": "2016-09-25T00:22:10.000+0000" }, { "id": "440040", "author": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Closing tickets that need more info from 2015 and earlier. Is this is in error, please reopen.", "updateAuthor": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-08-06T17:43:14.000+0000", "updated": "2018-08-06T17:43:14.000+0000" } ], "maxResults": 21, "total": 21, "startAt": 0 } } }