{ "id": "130892", "key": "TIMOB-17089", "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": "20432", "name": "Release 8.0.1", "archived": false, "released": true, "releaseDate": "2019-05-15" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2019-04-29T21:22:21.000+0000", "created": "2014-05-27T06:32:59.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [ "android" ], "versions": [], "issuelinks": [ { "id": "39437", "type": { "id": "10002", "name": "Duplicate", "inward": "is duplicated by", "outward": "duplicates" }, "outwardIssue": { "id": "133432", "key": "AC-1269", "fields": { "summary": "App crashed and the crash log show \"This view's id is id/0x65\".", "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" } }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } }, { "id": "57494", "type": { "id": "10002", "name": "Duplicate", "inward": "is duplicated by", "outward": "duplicates" }, "inwardIssue": { "id": "90616", "key": "AC-2921", "fields": { "summary": "[android] two views of different type have the same id", "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" } }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } }, { "id": "57495", "type": { "id": "10002", "name": "Duplicate", "inward": "is duplicated by", "outward": "duplicates" }, "inwardIssue": { "id": "172834", "key": "TIMOB-26982", "fields": { "summary": "Android: java.lang.ClassCastException: ti.modules.titanium.ui.widget.TiUILabel$1 cannot be cast to android.view.ViewGroup;", "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": "Critical", "id": "1" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } }, { "id": "57496", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "173214", "key": "TIMOB-26911", "fields": { "summary": "Crash log analysis when the app goes into the background.", "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": "None", "id": "6" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2019-05-05T08:17:10.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": "Occasionally when my app is resumed (clicking on it from the task list), it crashes with the following line:\r\n{noformat}\r\n05-27 09:21:12.394: E/TiApplication(22330): (main) [108,27001] Sending event: exception on thread: main msg:java.lang.RuntimeException: Unable to start activity ComponentInfo{com.pingapp.app/org.appcelerator.titanium.TiTranslucentActivity}: java.lang.IllegalArgumentException: Wrong state class, expecting View State but received class android.widget.AbsListView$SavedState instead. This usually happens when two views of different type have the same id in the same hierarchy. This view's id is id/0x65. Make sure other views do not use the same id.; Titanium 3.2.1,2014/05/26 11:25,84d47ff\r\n{noformat}\r\nThe cause is that the {{TiTableView}} constructor sets a constant id of {{TI_TABLE_VIEW_ID}} (which is 0x65) as the view id. Constant ids should never be used in an application.\r\n\r\nThis can be easily reproduced like this: build an application with many text views, at least 101. Add one table view. Now to cause the state restore, move the application to the back, enter system settings -> display -> font size, and change the size. Open the task list and select your app to bring it to front. The font size change will cause view state recalculation which will crash the app.\r\n\r\nTo fix this I added the following method to {{TiUIView}} and used it to set the id:\r\n{noformat}\r\nstatic public int getUniqueId() {\r\n if (idGenerator == null)\r\n idGenerator = new AtomicInteger(0);\r\n return idGenerator.incrementAndGet();\r\n}\r\n{noformat}\r\n\r\nA quick grep on \".setId(\" turned up other places in the sdk where you use constant ids - these need to be fixed as well.\r\n\r\nFull stack dump of the crash:\r\n{noformat}\r\n05-27 09:21:12.394: E/TiApplication(22330): (main) [108,27001] Sending event: exception on thread: main msg:java.lang.RuntimeException: Unable to start activity ComponentInfo{com.pingapp.app/org.appcelerator.titanium.TiTranslucentActivity}: java.lang.IllegalArgumentException: Wrong state class, expecting View State but received class android.widget.AbsListView$SavedState instead. This usually happens when two views of different type have the same id in the same hierarchy. This view's id is id/0x65. Make sure other views do not use the same id.; Titanium 3.2.1,2014/05/26 11:25,84d47ff\r\n05-27 09:21:12.394: E/TiApplication(22330): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.pingapp.app/org.appcelerator.titanium.TiTranslucentActivity}: java.lang.IllegalArgumentException: Wrong state class, expecting View State but received class android.widget.AbsListView$SavedState instead. This usually happens when two views of different type have the same id in the same hierarchy. This view's id is id/0x65. Make sure other views do not use the same id.\r\n05-27 09:21:12.394: E/TiApplication(22330): \tat android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2339)\r\n05-27 09:21:12.394: E/TiApplication(22330): \tat android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2389)\r\n05-27 09:21:12.394: E/TiApplication(22330): \tat android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:3868)\r\n05-27 09:21:12.394: E/TiApplication(22330): \tat android.app.ActivityThread.access$700(ActivityThread.java:153)\r\n05-27 09:21:12.394: E/TiApplication(22330): \tat android.app.ActivityThread$H.handleMessage(ActivityThread.java:1275)\r\n05-27 09:21:12.394: E/TiApplication(22330): \tat android.os.Handler.dispatchMessage(Handler.java:99)\r\n05-27 09:21:12.394: E/TiApplication(22330): \tat android.os.Looper.loop(Looper.java:137)\r\n05-27 09:21:12.394: E/TiApplication(22330): \tat android.app.ActivityThread.main(ActivityThread.java:5289)\r\n05-27 09:21:12.394: E/TiApplication(22330): \tat java.lang.reflect.Method.invokeNative(Native Method)\r\n05-27 09:21:12.394: E/TiApplication(22330): \tat java.lang.reflect.Method.invoke(Method.java:525)\r\n05-27 09:21:12.394: E/TiApplication(22330): \tat com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:739)\r\n05-27 09:21:12.394: E/TiApplication(22330): \tat com.android.internal.os.ZygoteInit.main(ZygoteInit.java:555)\r\n05-27 09:21:12.394: E/TiApplication(22330): \tat dalvik.system.NativeStart.main(Native Method)\r\n05-27 09:21:12.394: E/TiApplication(22330): Caused by: java.lang.IllegalArgumentException: Wrong state class, expecting View State but received class android.widget.AbsListView$SavedState instead. This usually happens when two views of different type have the same id in the same hierarchy. This view's id is id/0x65. Make sure other views do not use the same id.\r\n05-27 09:21:12.394: E/TiApplication(22330): \tat android.view.View.onRestoreInstanceState(View.java:12315)\r\n05-27 09:21:12.394: E/TiApplication(22330): \tat android.widget.TextView.onRestoreInstanceState(TextView.java:3495)\r\n05-27 09:21:12.394: E/TiApplication(22330): \tat android.view.View.dispatchRestoreInstanceState(View.java:12291)\r\n05-27 09:21:12.394: E/TiApplication(22330): \tat android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:2626)\r\n05-27 09:21:12.394: E/TiApplication(22330): \tat android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:2626)\r\n05-27 09:21:12.394: E/TiApplication(22330): \tat android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:2626)\r\n05-27 09:21:12.394: E/TiApplication(22330): \tat android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:2626)\r\n05-27 09:21:12.394: E/TiApplication(22330): \tat android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:2626)\r\n05-27 09:21:12.394: E/TiApplication(22330): \tat android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:2626)\r\n05-27 09:21:12.394: E/TiApplication(22330): \tat android.view.View.restoreHierarchyState(View.java:12269)\r\n05-27 09:21:12.394: E/TiApplication(22330): \tat com.android.internal.policy.impl.PhoneWindow.restoreHierarchyState(PhoneWindow.java:1700)\r\n05-27 09:21:12.394: E/TiApplication(22330): \tat android.app.Activity.onRestoreInstanceState(Activity.java:938)\r\n05-27 09:21:12.394: E/TiApplication(22330): \tat org.appcelerator.titanium.TiBaseActivity.onRestoreInstanceState(TiBaseActivity.java:1316)\r\n05-27 09:21:12.394: E/TiApplication(22330): \tat android.app.Activity.performRestoreInstanceState(Activity.java:910)\r\n05-27 09:21:12.394: E/TiApplication(22330): \tat android.app.Instrumentation.callActivityOnRestoreInstanceState(Instrumentation.java:1138)\r\n05-27 09:21:12.394: E/TiApplication(22330): \tat android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2307)\r\n{noformat}\r\n\\\\\r\n----\r\nThis often happens with TabGroups as well when a tab's fragment is restored. See...\r\n{code}\r\n[ERROR] TiExceptionHandler: (main) [156856,156856] Unable to start activity ComponentInfo{com.miga.app/org.appcelerator.titanium.TiActivity}: java.lang.ClassCastException: ti.modules.titanium.ui.widget.TiUILabel$1 cannot be cast to android.view.ViewGroup\r\n[ERROR] TiExceptionHandler:\r\n[ERROR] TiExceptionHandler: android.support.v4.app.FragmentTransition.configureTransitionsOrdered(FragmentTransition.java:310)\r\n[ERROR] TiExceptionHandler: android.support.v4.app.FragmentTransition.startTransitions(FragmentTransition.java:134)\r\n[ERROR] TiExceptionHandler: android.support.v4.app.FragmentManagerImpl.executeOpsTogether(FragmentManager.java:2380)\r\n[ERROR] TiExceptionHandler: android.support.v4.app.FragmentManagerImpl.removeRedundantOperationsAndExecute(FragmentManager.java:2338)\r\n[ERROR] TiExceptionHandler: android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:2245)\r\n[ERROR] TiExceptionHandler: android.support.v4.app.FragmentManagerImpl.dispatchStateChange(FragmentManager.java:3248)\r\n[ERROR] TiExceptionHandler: android.support.v4.app.FragmentManagerImpl.dispatchActivityCreated(FragmentManager.java:3200)\r\n[ERROR] TiExceptionHandler: android.support.v4.app.FragmentController.dispatchActivityCreated(FragmentController.java:195)\r\n[ERROR] TiExceptionHandler: android.support.v4.app.FragmentActivity.onStart(FragmentActivity.java:597)\r\n[ERROR] TiExceptionHandler: android.support.v7.app.AppCompatActivity.onStart(AppCompatActivity.java:177)\r\n[ERROR] TiExceptionHandler: org.appcelerator.titanium.TiBaseActivity.onStart(TiBaseActivity.java:1504)\r\n[ERROR] TiExceptionHandler: android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1299)\r\n[ERROR] TiExceptionHandler: android.app.Activity.performStart(Activity.java:6690)\r\n[ERROR] TiExceptionHandler: android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2688)\r\n[ERROR] TiExceptionHandler: android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2786)\r\n[ERROR] TiExceptionHandler: android.app.ActivityThread.-wrap12(ActivityThread.java)\r\n[ERROR] TiExceptionHandler: android.app.ActivityThread$H.handleMessage(ActivityThread.java:1501)\r\n[ERROR] TiExceptionHandler: android.os.Handler.dispatchMessage(Handler.java:102)\r\n[ERROR] TiExceptionHandler: android.os.Looper.loop(Looper.java:173)\r\n[ERROR] TiExceptionHandler: android.app.ActivityThread.main(ActivityThread.java:6459)\r\n[ERROR] TiExceptionHandler: java.lang.reflect.Method.invoke(Native Method)\r\n[ERROR] TiExceptionHandler: com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:938)\r\n[ERROR] TiExceptionHandler: com.android.internal.os.ZygoteInit.main(ZygoteInit.java:828)\r\n{code}\r\n", "attachment": [], "flagged": false, "summary": "Android: Activity/Fragment restore can sometimes crash app due to view ID collision", "creator": { "name": "buddyguards", "key": "buddyguards", "displayName": "grebulon", "active": true, "timeZone": "Asia/Jerusalem" }, "subtasks": [], "reporter": { "name": "buddyguards", "key": "buddyguards", "displayName": "grebulon", "active": true, "timeZone": "Asia/Jerusalem" }, "environment": null, "closedSprints": [ { "id": 1124, "state": "closed", "name": "2019 Sprint 8", "startDate": "2019-03-31T18:03:00.000Z", "endDate": "2019-04-12T18:03:00.000Z", "completeDate": "2019-04-12T19:04:50.175Z", "originBoardId": 114 }, { "id": 1128, "state": "closed", "name": "2019 Sprint 9", "startDate": "2019-04-14T19:05:00.000Z", "endDate": "2019-04-26T19:05:00.000Z", "completeDate": "2019-04-26T22:05:13.933Z", "originBoardId": 114 }, { "id": 1129, "state": "closed", "name": "2019 Sprint 10", "startDate": "2019-04-28T22:06:00.000Z", "endDate": "2019-05-17T22:06:00.000Z", "completeDate": "2019-05-20T16:48:42.522Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "344558", "author": { "name": "fahad86", "key": "fahad86", "displayName": "Muhammad Ahmed Fahad", "active": true, "timeZone": "Asia/Shanghai" }, "body": "I'm having the exact same issue as well. Any progress on this? ", "updateAuthor": { "name": "fahad86", "key": "fahad86", "displayName": "Muhammad Ahmed Fahad", "active": true, "timeZone": "Asia/Shanghai" }, "created": "2015-02-27T11:32:02.000+0000", "updated": "2015-02-27T11:32:02.000+0000" }, { "id": "344721", "author": { "name": "buddyguards", "key": "buddyguards", "displayName": "grebulon", "active": true, "timeZone": "Asia/Jerusalem" }, "body": "Looks like all titanium users are building simple applications with small number of UI elements. Otherwise, there would be a bigger backlash.", "updateAuthor": { "name": "buddyguards", "key": "buddyguards", "displayName": "grebulon", "active": true, "timeZone": "Asia/Jerusalem" }, "created": "2015-03-01T11:36:35.000+0000", "updated": "2015-03-01T11:36:35.000+0000" }, { "id": "353594", "author": { "name": "peterladis", "key": "peterladis", "displayName": "Peter Ladis", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I am running 3.5.1 on a lollipop device and this is happening a lot. Same code..same SDK working fine on non-lollipop devices. Any idea?", "updateAuthor": { "name": "peterladis", "key": "peterladis", "displayName": "Peter Ladis", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2015-05-27T02:38:26.000+0000", "updated": "2015-05-27T02:38:26.000+0000" }, { "id": "353597", "author": { "name": "fahad86", "key": "fahad86", "displayName": "Muhammad Ahmed Fahad", "active": true, "timeZone": "Asia/Shanghai" }, "body": "@Peter Ladis, for a workaround try changing your TableViews to Scroll/List Views where possible and check if the problem still exists", "updateAuthor": { "name": "fahad86", "key": "fahad86", "displayName": "Muhammad Ahmed Fahad", "active": true, "timeZone": "Asia/Shanghai" }, "created": "2015-05-27T02:50:14.000+0000", "updated": "2015-05-27T02:50:14.000+0000" }, { "id": "353599", "author": { "name": "peterladis", "key": "peterladis", "displayName": "Peter Ladis", "active": true, "timeZone": "America/Los_Angeles" }, "body": "@muhammed - that is a huge change for my app. - is there anything else", "updateAuthor": { "name": "peterladis", "key": "peterladis", "displayName": "Peter Ladis", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2015-05-27T02:56:20.000+0000", "updated": "2015-05-27T02:56:20.000+0000" }, { "id": "353603", "author": { "name": "fahad86", "key": "fahad86", "displayName": "Muhammad Ahmed Fahad", "active": true, "timeZone": "Asia/Shanghai" }, "body": "@Peter, that's the one thing which seemed to have a visible direct impact on the number of these errors going down (to 0) on the production version of our app", "updateAuthor": { "name": "fahad86", "key": "fahad86", "displayName": "Muhammad Ahmed Fahad", "active": true, "timeZone": "Asia/Shanghai" }, "created": "2015-05-27T03:59:03.000+0000", "updated": "2015-05-27T03:59:03.000+0000" }, { "id": "447634", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "PR (master): https://github.com/appcelerator/titanium_mobile/pull/10829", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-04-12T01:54:18.000+0000", "updated": "2019-04-12T01:54:18.000+0000" }, { "id": "447992", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "PR (8.0.x): https://github.com/appcelerator/titanium_mobile/pull/10868", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-04-26T22:31:22.000+0000", "updated": "2019-04-26T22:31:22.000+0000" }, { "id": "448002", "author": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "body": "FR passed PR merged.", "updateAuthor": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-04-26T23:17:20.000+0000", "updated": "2019-04-26T23:17:20.000+0000" }, { "id": "448040", "author": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket, fix verified in SDK version 8.0.1.v20190426162041 and SDK version 8.1.0.v20190426222341.\r\n\r\nTest and other information can be found at: \r\nMaster : https://github.com/appcelerator/titanium_mobile/pull/10829\r\n8_0_X: https://github.com/appcelerator/titanium_mobile/pull/10868\r\n\r\n", "updateAuthor": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-04-29T14:46:07.000+0000", "updated": "2019-04-29T14:46:07.000+0000" }, { "id": "448183", "author": { "name": "buddyguards", "key": "buddyguards", "displayName": "grebulon", "active": true, "timeZone": "Asia/Jerusalem" }, "body": "Took 5 years...", "updateAuthor": { "name": "buddyguards", "key": "buddyguards", "displayName": "grebulon", "active": true, "timeZone": "Asia/Jerusalem" }, "created": "2019-05-05T08:17:10.000+0000", "updated": "2019-05-05T08:17:10.000+0000" } ], "maxResults": 11, "total": 11, "startAt": 0 } } }