{ "id": "175638", "key": "TIMOB-28189", "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": "21052", "description": "", "name": "Release 9.3.0", "archived": false, "released": true, "releaseDate": "2020-12-14" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2020-11-24T18:41:04.000+0000", "created": "2020-10-13T00:05:51.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [ "TabGroup", "android", "open", "regression", "theme" ], "versions": [ { "id": "21052", "description": "", "name": "Release 9.3.0", "archived": false, "released": true, "releaseDate": "2020-12-14" } ], "issuelinks": [], "assignee": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2020-11-24T18:41:04.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\nWhen the app is using a {{Theme.AppCompat}} derived theme, opening a {{TabGroup}} will throw an exception as of Titanium 9.3.0 stating the app needs to use {{Theme.MaterialComponents}}. It should only throw this exception when using the \"badge\" or \"badgeColor\" property.\r\n\r\nThis regression was caught before release.\r\n\r\n*Steps to reproduce:*\r\n# Create a Classic Titanium app project.\r\n# Copy the below {{}} theme to project's \"tiapp.xml\" file.\r\n# Copy the below \"app.js\" to the project.\r\n# Build and run on Android.\r\n\r\ntiapp.xml\r\n{code:xml}\r\n\r\n\t\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t\r\n\r\n{code}\r\n\r\napp.js\r\n{code:java}\r\nfunction createTab(title) {\r\n\tvar window = Ti.UI.createWindow({ title: title });\r\n\twindow.add(Ti.UI.createLabel({ text: title + \" View\" }));\r\n\tvar tab = Ti.UI.createTab({\r\n\t\ttitle: title,\r\n\t\twindow: window,\r\n\t});\r\n\treturn tab;\r\n}\r\n\r\nvar tabGroupSettings = {\r\n\ttabs: [createTab(\"Tab 1\"), createTab(\"Tab 2\"), createTab(\"Tab 3\")],\r\n};\r\nif (OS_ANDROID) {\r\n\ttabGroupSettings.shiftMode = false;\r\n\ttabGroupSettings.style = Ti.UI.Android.TABS_STYLE_BOTTOM_NAVIGATION;\r\n}\r\nvar tabGroup = Ti.UI.createTabGroup(tabGroupSettings);\r\ntabGroup.open();\r\n{code}\r\n\r\n*Result:*\r\nApp crashes with the following exception...\r\n{code}\r\n[ERROR] TiExceptionHandler: (main) [206,322] Unable to start activity ComponentInfo{com.appcelerator.testing/org.appcelerator.titanium.TiActivity}: java.lang.IllegalArgumentException: The style on this component requires your app theme to be Theme.MaterialComponents (or a descendant).\r\n[ERROR] TiExceptionHandler:\r\n[ERROR] TiExceptionHandler: com.google.android.material.internal.ThemeEnforcement.checkTheme(ThemeEnforcement.java:248)\r\n[ERROR] TiExceptionHandler: com.google.android.material.internal.ThemeEnforcement.checkMaterialTheme(ThemeEnforcement.java:222)\r\n[ERROR] TiExceptionHandler: com.google.android.material.badge.BadgeDrawable.(BadgeDrawable.java:361)\r\n[ERROR] TiExceptionHandler: com.google.android.material.badge.BadgeDrawable.createFromAttributes(BadgeDrawable.java:294)\r\n[ERROR] TiExceptionHandler: com.google.android.material.badge.BadgeDrawable.create(BadgeDrawable.java:262)\r\n[ERROR] TiExceptionHandler: com.google.android.material.bottomnavigation.BottomNavigationMenuView.getOrCreateBadge(BottomNavigationMenuView.java:647)\r\n[ERROR] TiExceptionHandler: com.google.android.material.bottomnavigation.BottomNavigationView.getOrCreateBadge(BottomNavigationView.java:674)\r\n[ERROR] TiExceptionHandler: ti.modules.titanium.ui.widget.tabgroup.TiUIBottomNavigationTabGroup.updateBadge(TiUIBottomNavigationTabGroup.java:296)\r\n[ERROR] TiExceptionHandler: ti.modules.titanium.ui.widget.tabgroup.TiUIBottomNavigationTabGroup.updateDrawablesAfterNewItem(TiUIBottomNavigationTabGroup.java:195)\r\n[ERROR] TiExceptionHandler: ti.modules.titanium.ui.widget.tabgroup.TiUIBottomNavigationTabGroup.addTabItemInController(TiUIBottomNavigationTabGroup.java:171)\r\n[ERROR] TiExceptionHandler: ti.modules.titanium.ui.widget.tabgroup.TiUIAbstractTabGroup.addTab(TiUIAbstractTabGroup.java:263)\r\n[ERROR] TiExceptionHandler: ti.modules.titanium.ui.widget.tabgroup.TiUIBottomNavigationTabGroup.addTab(TiUIBottomNavigationTabGroup.java:65)\r\n[ERROR] TiExceptionHandler: ti.modules.titanium.ui.TabGroupProxy.handlePostOpen(TabGroupProxy.java:480)\r\n[ERROR] TiExceptionHandler: ti.modules.titanium.ui.TabGroupProxy.onWindowActivityCreated(TabGroupProxy.java:462)\r\n[ERROR] TiExceptionHandler: org.appcelerator.titanium.TiBaseActivity.onCreate(TiBaseActivity.java:756)\r\n[ERROR] TiExceptionHandler: org.appcelerator.titanium.TiActivity.onCreate(TiActivity.java:47)\r\n[ERROR] TiExceptionHandler: android.app.Activity.performCreate(Activity.java:8000)\r\n[ERROR] TiExceptionHandler: android.app.Activity.performCreate(Activity.java:7984)\r\n[ERROR] TiExceptionHandler: android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1309)\r\n[ERROR] TiExceptionHandler: android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3422)\r\n[ERROR] TiExceptionHandler: android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3601)\r\n[ERROR] TiExceptionHandler: android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:85)\r\n[ERROR] TiExceptionHandler: android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)\r\n[ERROR] TiExceptionHandler: android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)\r\n[ERROR] TiExceptionHandler: android.app.ActivityThread$H.handleMessage(ActivityThread.java:2066)\r\n[ERROR] TiExceptionHandler: android.os.Handler.dispatchMessage(Handler.java:106)\r\n[ERROR] TiExceptionHandler: android.os.Looper.loop(Looper.java:223)\r\n[ERROR] TiExceptionHandler: android.app.ActivityThread.main(ActivityThread.java:7656)\r\n[ERROR] TiExceptionHandler: java.lang.reflect.Method.invoke(Native Method)\r\n[ERROR] TiExceptionHandler: com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)\r\n[ERROR] TiExceptionHandler: com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)\r\n{code}\r\n\r\n*Expected Result:*\r\nShould not crash if the [Tab.badge|https://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.Tab-property-badge] property is not set. However, if the code does set this property, then this error does make sense because it can't natively work without using a {{Theme.MaterialComponents}} derived theme. So, it should only throw or log the exception when this property is assigned.\r\n", "attachment": [], "flagged": false, "summary": "Android: Opening TabGroup crashes when using AppCompat theme as of 9.3.0", "creator": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "closedSprints": [ { "id": 1208, "state": "closed", "name": "2020 Sprint 21", "startDate": "2020-10-12T16:34:00.000Z", "endDate": "2020-10-23T16:34:00.000Z", "completeDate": "2020-10-23T02:32:43.674Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "457239", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "PR (master): https://github.com/appcelerator/titanium_mobile/pull/12175", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-10-13T02:18:47.000+0000", "updated": "2020-10-13T02:18:47.000+0000" }, { "id": "457296", "author": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "body": "FR Passed, waiting on Jenkins build.", "updateAuthor": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-10-21T14:42:14.000+0000", "updated": "2020-10-21T14:42:14.000+0000" }, { "id": "457297", "author": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "body": "merged to master for 9.3.0 target", "updateAuthor": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "created": "2020-10-21T15:17:30.000+0000", "updated": "2020-10-21T15:17:30.000+0000" }, { "id": "457708", "author": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Closing.", "updateAuthor": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-11-24T18:41:00.000+0000", "updated": "2020-11-24T18:41:00.000+0000" } ], "maxResults": 4, "total": 4, "startAt": 0 } } }