{ "id": "173035", "key": "TIMOB-26843", "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": "19882", "name": "Release 8.0.0", "archived": false, "released": true, "releaseDate": "2019-03-14" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2019-03-08T18:34:23.000+0000", "created": "2019-02-21T16:04:25.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [ "TabGroup", "android", "regression" ], "versions": [ { "id": "19882", "name": "Release 8.0.0", "archived": false, "released": true, "releaseDate": "2019-03-14" } ], "issuelinks": [ { "id": "57157", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "158326", "key": "TIMOB-22376", "fields": { "summary": "Ti.UI.TabGroup Test Suite: Titanium.UI.TabGroup Acceptance TIMOB-12244", "status": { "description": "The issue is open and ready for the assignee to start work on it.", "name": "Open", "id": "1", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "priority": { "name": "None", "id": "6" }, "issuetype": { "id": "10100", "description": "This Issue Type is used to create Zephyr Test within Jira.", "name": "Test", "subtask": false } } } }, { "id": "57154", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "158352", "key": "TIMOB-22402", "fields": { "summary": "Ti.UI.TabGroup Test Suite: Titanium.UI.TabGroup Acceptance TIMOB-16912", "status": { "description": "The issue is open and ready for the assignee to start work on it.", "name": "Open", "id": "1", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "priority": { "name": "None", "id": "6" }, "issuetype": { "id": "10100", "description": "This Issue Type is used to create Zephyr Test within Jira.", "name": "Test", "subtask": false } } } } ], "assignee": { "name": "ybanev", "key": "ybanev", "displayName": "Yordan Banev", "active": true, "timeZone": "Europe/Athens" }, "updated": "2019-03-08T18:34:23.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": "*Summary:*\r\nGetting or setting the {{TabGroup}} \"activeTab\" property (or calling {{getActiveTab()}} or {{setActiveTab()}} methods) before the {{TabGroup}} has been opened causes a crash on Android as of Titanium 8.0.0.RC.\r\n\r\n*Steps to reproduce*\r\n# Build and run the below code via Titanium 8.0.0.RC on Android.\r\n# Notice the app crashes on startup.\r\n\r\n*Testcase*\r\n{noformat}\r\nvar tabGroup = Ti.UI.createTabGroup();\r\n\r\nvar win1 = Titanium.UI.createWindow({\r\n title: 'Tab 1',\r\n backgroundColor: '#fff'\r\n});\r\nvar tab1 = Titanium.UI.createTab({\r\n title: 'Tab 1',\r\n window: win1\r\n});\r\n\r\nvar label1 = Titanium.UI.createLabel({\r\n color: '#999',\r\n text: 'I am Window 1',\r\n textAlign: 'center',\r\n width: 'auto'\r\n});\r\n\r\nwin1.add(label1);\r\nvar win2 = Titanium.UI.createWindow({\r\n title: 'Tab 2',\r\n backgroundColor: '#fff'\r\n});\r\nvar tab2 = Titanium.UI.createTab({\r\n title: 'Tab 2',\r\n window: win2\r\n});\r\n\r\nvar label2 = Titanium.UI.createLabel({\r\n color: '#999',\r\n text: 'I am Window 2',\r\n textAlign: 'center',\r\n width: 'auto'\r\n});\r\n\r\nwin2.add(label2);\r\ntabGroup.addTab(tab1);\r\ntabGroup.addTab(tab2);\r\ntabGroup.activeTab = 1;\r\nTi.API.info(\"### activeTab: \" + tabGroup.activeTab);\r\ntabGroup.open();\r\n{noformat}\r\n\r\n*Expected*\r\nNo error is thrown and the seconf tab is in focus\r\n\r\n*Actual*\r\n{noformat}\r\n[ERROR] TiExceptionHandler: (main) [70,70] Attempt to invoke virtual method 'void ti.modules.titanium.ui.widget.tabgroup.TiUITab.onSelectionChange(boolean)' on a null object reference\r\n[ERROR] TiExceptionHandler:\r\n[ERROR] TiExceptionHandler: ti.modules.titanium.ui.TabProxy.onSelectionChanged(TabProxy.java:220)\r\n[ERROR] TiExceptionHandler: ti.modules.titanium.ui.TabGroupProxy.onTabSelected(TabGroupProxy.java:551)\r\n[ERROR] TiExceptionHandler: ti.modules.titanium.ui.TabGroupProxy.onTabSelected(TabGroupProxy.java:521)\r\n[ERROR] TiExceptionHandler: ti.modules.titanium.ui.widget.tabgroup.TiUITabLayoutTabGroup.onTabSelected(TiUITabLayoutTabGroup.java:232)\r\n[ERROR] TiExceptionHandler: android.support.design.widget.TabLayout.dispatchTabSelected(TabLayout.java:1165)\r\n[ERROR] TiExceptionHandler: android.support.design.widget.TabLayout.selectTab(TabLayout.java:1158)\r\n[ERROR] TiExceptionHandler: android.support.design.widget.TabLayout.selectTab(TabLayout.java:1128)\r\n[ERROR] TiExceptionHandler: android.support.design.widget.TabLayout$Tab.select(TabLayout.java:1427)\r\n[ERROR] TiExceptionHandler: android.support.design.widget.TabLayout.addTab(TabLayout.java:483)\r\n[ERROR] TiExceptionHandler: android.support.design.widget.TabLayout.addTab(TabLayout.java:465)\r\n[ERROR] TiExceptionHandler: android.support.design.widget.TabLayout.addTab(TabLayout.java:444)\r\n[ERROR] TiExceptionHandler: ti.modules.titanium.ui.widget.tabgroup.TiUITabLayoutTabGroup.addTabItemInController(TiUITabLayoutTabGroup.java:159)\r\n[ERROR] TiExceptionHandler: ti.modules.titanium.ui.widget.tabgroup.TiUIAbstractTabGroup.addTab(TiUIAbstractTabGroup.java:199)\r\n[ERROR] TiExceptionHandler: ti.modules.titanium.ui.TabGroupProxy.handlePostOpen(TabGroupProxy.java:442)\r\n[ERROR] TiExceptionHandler: ti.modules.titanium.ui.TabGroupProxy.windowCreated(TabGroupProxy.java:416)\r\n[ERROR] TiExceptionHandler: org.appcelerator.titanium.TiActivityWindows.windowCreated(TiActivityWindows.java:33)\r\n[ERROR] TiExceptionHandler: org.appcelerator.titanium.TiBaseActivity.windowCreated(TiBaseActivity.java:624)\r\n[ERROR] TiExceptionHandler: org.appcelerator.titanium.TiBaseActivity.onCreate(TiBaseActivity.java:767)\r\n[ERROR] TiExceptionHandler: org.appcelerator.titanium.TiActivity.onCreate(TiActivity.java:21)\r\n[ERROR] TiExceptionHandler: android.app.Activity.performCreate(Activity.java:6975)\r\n[ERROR] TiExceptionHandler: android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1213)\r\n[ERROR] TiExceptionHandler: android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2770)\r\n[ERROR] TiExceptionHandler: android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2892)\r\n[ERROR] TiExceptionHandler: android.app.ActivityThread.-wrap11(Unknown Source:0)\r\n[ERROR] TiExceptionHandler: android.app.ActivityThread$H.handleMessage(ActivityThread.java:1593)\r\n[ERROR] TiExceptionHandler: android.os.Handler.dispatchMessage(Handler.java:105)\r\n[ERROR] TiExceptionHandler: android.os.Looper.loop(Looper.java:164)\r\n[ERROR] TiExceptionHandler: android.app.ActivityThread.main(ActivityThread.java:6541)\r\n[ERROR] TiExceptionHandler: java.lang.reflect.Method.invoke(Native Method)\r\n[ERROR] TiExceptionHandler: com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)\r\n[ERROR] TiExceptionHandler: com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)\r\n{noformat}\r\n\r\n*Note:*\r\nIt will crash when set via a {{Ti.UI.createTabGroup()}} creation property as well.\r\n\r\n*Work-Around:*\r\nYou can set the active tab after the {{TabGroup}} has been opened as shown below.\r\n{code:javascript}\r\ntabGroup.addEventListener(\"open\", function() {\r\n\ttabGroup.activeTab = 1;\r\n});\r\n{code}\r\n", "attachment": [], "flagged": false, "summary": "Android: Getting/Setting TabGroup \"activeTab\" property before open causes a crash as of 8.0.0.RC", "creator": { "name": "jlongton", "key": "jlongton", "displayName": "Josh Longton", "active": true, "timeZone": "Europe/London" }, "subtasks": [], "reporter": { "name": "jlongton", "key": "jlongton", "displayName": "Josh Longton", "active": true, "timeZone": "Europe/London" }, "environment": null, "closedSprints": [ { "id": 1112, "state": "closed", "name": "2019 Sprint 4", "startDate": "2019-02-11T16:16:38.316Z", "endDate": "2019-02-23T16:16:00.000Z", "completeDate": "2019-02-24T18:35:43.422Z", "originBoardId": 114 }, { "id": 1118, "state": "closed", "name": "2019 Sprint 5", "startDate": "2019-02-24T18:36:06.435Z", "endDate": "2019-03-08T18:36:00.000Z", "completeDate": "2019-03-07T22:19:47.057Z", "originBoardId": 114 }, { "id": 1119, "state": "closed", "name": "2019 Sprint 6", "startDate": "2019-03-03T22:20:00.193Z", "endDate": "2019-03-15T22:20:00.000Z", "completeDate": "2019-03-18T17:26:43.120Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "446233", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "We only have 1 unit test for setting \"activeTab\" and it is done after the {{TabGroup}} has been opened.\r\nhttps://github.com/appcelerator/titanium-mobile-mocha-suite/blob/master/Resources/ti.ui.tabgroup.test.js\r\n\r\nWe should add 2 more unit tests for:\r\n* Setting \"activeTab\" to an integer via a {{Ti.UI.createTabGroup()}} creation property.\r\n* Setting \"activeTab\" to an integer after the {{Ti.UI.createTabGroup()}} function call, but before open.\r\n\r\nFor both tests above, we should read the {{TabGroup.activeTab}} property immediately afterwards and verify that it is assigned to the correct value. This is to verify that the getter does not crash on Android either.\r\n\r\nI've tested doing the above on iOS (assigning them to an int before open) and it works fine. This is just a regression on Android in 8.0.0.RC.\r\n", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-02-21T20:26:43.000+0000", "updated": "2019-02-21T20:26:43.000+0000" }, { "id": "446244", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "We also have an API doc issue.\r\n\r\nWe document that the {{TabGroup.setActiveTab()}} method (which is deprecated as of 8.0.0) supports types {{Number}} and {{Ti.UI.Tab}}, which is true. Our {{TabGroup.activeTab}} property documents that it only supports {{Ti.UI.Tab}}. The property's documentation needs to be updated to indicate it supports {{Number}} as well, just like the setter method.\r\nhttps://github.com/appcelerator/titanium_mobile/blob/master/apidoc/Titanium/UI/TabGroup.yml#L269\r\n", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-02-22T03:35:57.000+0000", "updated": "2019-02-22T03:35:57.000+0000" }, { "id": "446437", "author": { "name": "ybanev", "key": "ybanev", "displayName": "Yordan Banev", "active": true, "timeZone": "Europe/Athens" }, "body": "PR: https://github.com/appcelerator/titanium_mobile/pull/10740", "updateAuthor": { "name": "ybanev", "key": "ybanev", "displayName": "Yordan Banev", "active": true, "timeZone": "Europe/Athens" }, "created": "2019-03-01T10:31:41.000+0000", "updated": "2019-03-01T10:31:41.000+0000" }, { "id": "446519", "author": { "name": "kmahalingam", "key": "kmahalingam", "displayName": "Keerthi Mahalingam", "active": false, "timeZone": "America/Los_Angeles" }, "body": "FR passed. Waiting for resolving Test failure in jenkins and back port PR for 8.0", "updateAuthor": { "name": "kmahalingam", "key": "kmahalingam", "displayName": "Keerthi Mahalingam", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2019-03-04T22:23:57.000+0000", "updated": "2019-03-04T22:23:57.000+0000" }, { "id": "446614", "author": { "name": "ybanev", "key": "ybanev", "displayName": "Yordan Banev", "active": true, "timeZone": "Europe/Athens" }, "body": "PR (8_0_X): https://github.com/appcelerator/titanium_mobile/pull/10759", "updateAuthor": { "name": "ybanev", "key": "ybanev", "displayName": "Yordan Banev", "active": true, "timeZone": "Europe/Athens" }, "created": "2019-03-07T15:44:02.000+0000", "updated": "2019-03-07T15:44:02.000+0000" }, { "id": "446628", "author": { "name": "kmahalingam", "key": "kmahalingam", "displayName": "Keerthi Mahalingam", "active": false, "timeZone": "America/Los_Angeles" }, "body": "FR passed . Jenkins is failing. Waiting for Resolving jenkin test failure to merge.", "updateAuthor": { "name": "kmahalingam", "key": "kmahalingam", "displayName": "Keerthi Mahalingam", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2019-03-07T21:58:54.000+0000", "updated": "2019-03-07T21:58:54.000+0000" }, { "id": "446645", "author": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "body": "keerthi did the FR while this was still a PR on Github. I've merged the master and 8_0_X PRs.", "updateAuthor": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "created": "2019-03-08T18:34:23.000+0000", "updated": "2019-03-08T18:34:23.000+0000" } ], "maxResults": 7, "total": 7, "startAt": 0 } } }