{ "id": "107365", "key": "TIMOB-12204", "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": "15272", "description": "2013 Sprint 04 API", "name": "2013 Sprint 04 API", "archived": true, "released": true, "releaseDate": "2013-02-25" }, { "id": "14814", "description": "2013 Sprint 04", "name": "2013 Sprint 04", "archived": true, "released": true, "releaseDate": "2013-02-25" } ], "resolution": { "id": "5", "description": "All attempts at reproducing this issue failed, or not enough information was available to reproduce the issue. Reading the code produces no clues as to why this behavior would occur. If more information appears later, please reopen the issue.", "name": "Cannot Reproduce" }, "resolutiondate": "2013-02-21T18:34:42.000+0000", "created": "2013-01-03T22:10:21.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "api" ], "versions": [ { "id": "13505", "description": "Release 3.0.0", "name": "Release 3.0.0", "archived": true, "released": true, "releaseDate": "2012-12-14" } ], "issuelinks": [ { "id": "24128", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "107048", "key": "TIMOB-12148", "fields": { "summary": "Android: Action Bar backgroundImage isn't set properly in click event handlers.", "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": "High", "id": "2" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-03-21T21:58:21.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": "I'm creating an application based on the default two-tab app template (the new style, CommonJS one).\r\n\r\nWhen I try to initialize the home icon click handler in a tab group's open event handler, the app crashes with the following NullPointer exception:\r\n\r\n{code}I/TiAPI ( 686): Tab group open event.\r\nE/Proxy ( 686): Unable to lookup Proxy.prototype.setProperty\r\nI/Process ( 76): Sending signal. PID: 686 SIG: 3\r\nI/dalvikvm( 686): threadid=3: reacting to signal 3\r\nI/dalvikvm( 686): Wrote stack traces to '/data/anr/traces.txt'\r\nD/AndroidRuntime( 686): Shutting down VM\r\nW/dalvikvm( 686): threadid=1: thread exiting with uncaught exception (group=0x409c01f8)\r\nE/TiApplication( 686): (main) [643,643] Sending event: exception on thread: main msg:java.lang.NullPointerException; Titanium 3.0.0,2012/12/12 18:49,a5894b3\r\nE/TiApplication( 686): java.lang.NullPointerException\r\nE/TiApplication( 686): \tat org.appcelerator.titanium.proxy.ActionBarProxy.handleMessage(ActionBarProxy.java:222)\r\nE/TiApplication( 686): \tat android.os.Handler.dispatchMessage(Handler.java:95)\r\nE/TiApplication( 686): \tat android.os.Looper.loop(Looper.java:137)\r\nE/TiApplication( 686): \tat android.app.ActivityThread.main(ActivityThread.java:4424)\r\nE/TiApplication( 686): \tat java.lang.reflect.Method.invokeNative(Native Method)\r\nE/TiApplication( 686): \tat java.lang.reflect.Method.invoke(Method.java:511)\r\nE/TiApplication( 686): \tat com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)\r\nE/TiApplication( 686): \tat com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)\r\nE/TiApplication( 686): \tat dalvik.system.NativeStart.main(Native Method)\r\nE/AndroidRuntime( 686): FATAL EXCEPTION: main\r\nE/AndroidRuntime( 686): java.lang.NullPointerException\r\nE/AndroidRuntime( 686): \tat org.appcelerator.titanium.proxy.ActionBarProxy.handleMessage(ActionBarProxy.java:222)\r\nE/AndroidRuntime( 686): \tat android.os.Handler.dispatchMessage(Handler.java:95)\r\nE/AndroidRuntime( 686): \tat android.os.Looper.loop(Looper.java:137)\r\nE/AndroidRuntime( 686): \tat android.app.ActivityThread.main(ActivityThread.java:4424)\r\nE/AndroidRuntime( 686): \tat java.lang.reflect.Method.invokeNative(Native Method)\r\nE/AndroidRuntime( 686): \tat java.lang.reflect.Method.invoke(Method.java:511)\r\nE/AndroidRuntime( 686): \tat com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)\r\nE/AndroidRuntime( 686): \tat com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)\r\nE/AndroidRuntime( 686): \tat dalvik.system.NativeStart.main(Native Method)\r\nW/ActivityManager( 76): Force finishing activity com.appcelerator.actionbardemo/org.appcelerator.titanium.TiActivity\r\nW/WindowManager( 76): Failure taking screenshot for (180x273) to layer 21020\r\nW/ActivityManager( 76): Force finishing activity com.appcelerator.actionbardemo/.ActionbardemoActivity\r\n{code}\r\n\r\nTest code: \r\n\r\nCreate a new application using the Tabbed Application template.\r\n\r\nAdd the following code to ui/common/ApplicationTabGroup.js after the line `self.addTab(tab2);`:\r\n\r\n\r\n{code}\r\n\tif (Ti.Platform.name === 'android') {\r\n\t\tTi.API.info(\"Android\");\r\n\t\tself.addEventListener('open', function(e) {\r\n\t\t\tTi.API.info(\"Tab group open event.\");\r\n\t\t\tvar activity, actionBar;\r\n\t\t\tactivity = self.getActivity();\r\n\t\t\tvar view = Ti.UI.createImageView({\r\n\t\t\t\tbackgroundColor : \"red\",\r\n\t\t\t\timage : \"images/random_icon.png\",\r\n\t\t\t\twidth : 60,\r\n\t\t\t\theight : 60\r\n\t\t\t});\r\n\t\t\tactivity.onCreateOptionsMenu = function(e) {\r\n\t\t\t\tvar item, menu;\r\n\t\t\t\tmenu = e.menu;\r\n\t\t\t\tmenu.clear();\r\n\t\t\t\tif (tg.activeTab == tab1) {\r\n\t\t\t\t\titem = menu.add({\r\n\t\t\t\t\t\ttitle : 'Search',\r\n\t\t\t\t\t\ticon : \"images/random_icon.png\", // (Ti.Android.R.drawable.ic_menu_search ? Ti.Android.R.drawable.ic_menu_search : Ti.App.Android.R.drawable.appicon),\r\n\t\t\t\t\t\tshowAsAction : Ti.Android.SHOW_AS_ACTION_ALWAYS | Ti.Android.SHOW_AS_ACTION_COLLAPSE_ACTION_VIEW\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t\titem = menu.add({\r\n\t\t\t\t\ttitle : \"Text Item\",\r\n\t\t\t\t\ticon : 'KS-nav_icon.png',\r\n\t\t\t\t\tshowAsAction : Ti.Android.SHOW_AS_ACTION_IF_ROOM | Ti.Android.SHOW_AS_ACTION_WITH_TEXT\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t\ttry {\r\n\t\t\t\tactionBar = activity.actionBar;\r\n\t\t\t\tif (actionBar) {\r\n\t\t\t\t\tactionBar.onHomeIconItemSelected = function() {\r\n\t\t\t\t\t\tTi.API.info(\"Home clicked\");\r\n\t\t\t\t\t};\r\n\t\t\t\t}\r\n\t\t\t} catch(exception) {\r\n\t\t\t\tTi.API.error(\"Couldn't home icon selected handler.\");\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n{code}\r\n\r\nAnd update the `tiapp.xml` so that you can use the action bar:\r\n\r\n{code}\r\n \r\n 16\r\n \r\n \r\n \r\n \r\n \r\n{code}\r\n\r\nWhen I use the same code in a non-commonJS project, it doesn't crash.\r\n", "attachment": [], "flagged": false, "summary": "Crash when accessing ActionBar on non-ActionBar window ", "creator": { "name": "aevans", "key": "aevans", "displayName": "Arthur Evans", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "aevans", "key": "aevans", "displayName": "Arthur Evans", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "233304", "author": { "name": "aevans", "key": "aevans", "displayName": "Arthur Evans", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Reproduced on master as well. ", "updateAuthor": { "name": "aevans", "key": "aevans", "displayName": "Arthur Evans", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-01-04T15:24:50.000+0000", "updated": "2013-01-04T15:24:50.000+0000" }, { "id": "233306", "author": { "name": "aevans", "key": "aevans", "displayName": "Arthur Evans", "active": true, "timeZone": "America/Los_Angeles" }, "body": "These issues both show the same error:\r\n\r\nUnable to lookup Proxy.prototype.setProperty\r\n\r\nNot sure if this is significant or not.\r\n", "updateAuthor": { "name": "aevans", "key": "aevans", "displayName": "Arthur Evans", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-01-04T15:35:39.000+0000", "updated": "2013-01-04T15:35:39.000+0000" }, { "id": "233706", "author": { "name": "aevans", "key": "aevans", "displayName": "Arthur Evans", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Further notes. I tried this on the single-window template with the same results.\n\nAfter some experimentation, it appears that this crash was caused by trying to access the action bar when the current window DOESN'T have an action bar theme -- for example, because the window was created as translucent or with modal: true.\n\nAccordingly, I'm going to knock down the severity a little, but this is still an uncatchable exception. In this case, we should either throw a JS exception or simply return undefined for the actionBar property, so the user can handle the case appropriately. As it stands, I don't think there's any way for the user to test whether the current window supports an action bar.", "updateAuthor": { "name": "aevans", "key": "aevans", "displayName": "Arthur Evans", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-01-09T13:02:21.000+0000", "updated": "2013-01-09T13:02:21.000+0000" }, { "id": "239283", "author": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Cannot reproduce with the latest master.", "updateAuthor": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-02-21T18:34:22.000+0000", "updated": "2013-02-21T18:34:22.000+0000" }, { "id": "275283", "author": { "name": "cdr", "key": "cdr", "displayName": "Chris Rose", "active": true, "timeZone": "Europe/London" }, "body": "I can reproduce this in 3.1.3, when a window is opened with modal: true.\r\n\r\nI'll attach a test case.", "updateAuthor": { "name": "cdr", "key": "cdr", "displayName": "Chris Rose", "active": true, "timeZone": "Europe/London" }, "created": "2013-10-16T16:11:10.000+0000", "updated": "2013-10-16T16:11:10.000+0000" }, { "id": "414510", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as the issue cannot be reproduced and due to the above comments.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-21T21:58:21.000+0000", "updated": "2017-03-21T21:58:21.000+0000" } ], "maxResults": 6, "total": 6, "startAt": 0 } } }