Titanium JIRA Archive
Appcelerator Community (AC)

[AC-2921] [android] two views of different type have the same id

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionCannot Reproduce
Resolution Date2012-09-18T11:47:25.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsTitanium SDK & CLI
Labelsandroid, crash, state, view
ReporterMartin Guillon
AssigneeMauro Parra-Miranda
Created2012-04-19T23:59:26.000+0000
Updated2019-04-11T23:47:44.000+0000

Description

I just had a crash. and From the description i suppose 2 of the views i created found themselves with the same id 0x65. I sadly cant find which one!
 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.
	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1840)
	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1856)
	at android.app.ActivityThread.access$500(ActivityThread.java:125)
	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1049)
	at android.os.Handler.dispatchMessage(Handler.java:99)
	at android.os.Looper.loop(Looper.java:132)
	at android.app.ActivityThread.main(ActivityThread.java:4157)
	at java.lang.reflect.Method.invokeNative(Native Method)
	at java.lang.reflect.Method.invoke(Method.java:491)
	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:841)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:599)
	at dalvik.system.NativeStart.main(Native Method)
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.
	at android.view.View.onRestoreInstanceState(View.java:8340)
	at android.widget.TextView.onRestoreInstanceState(TextView.java:2557)
	at android.view.View.dispatchRestoreInstanceState(View.java:8316)
	at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:2024)
	at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:2024)
	at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:2024)
	at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:2024)
	at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:2024)
	at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:2024)
	at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:2024)
	at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:2024)
	at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:2024)
	at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:2024)
	at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:2024)
	at android.view.View.restoreHierarchyState(View.java:8295)
	at com.android.internal.policy.impl.PhoneWindow.restoreHierarchyState(PhoneWindow.java:1489)
	at android.app.Activity.onRestoreInstanceState(Activity.java:898)
	at android.app.Activity.performRestoreInstanceState(Activity.java:870)
	at android.app.Instrumentation.callActivityOnRestoreInstanceState(Instrumentation.java:1099)
	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1818)
	... 11 more

Comments

  1. Mauro Parra-Miranda 2012-05-14

    Hello, please provide a testcase. Follow this instructions to submit a report: https://wiki.appcelerator.org/display/guides2/How+to+Submit+a+Bug+Report Best, Mauro
  2. Mauro Parra-Miranda 2012-09-18

    Can't reproduce in 2.1.2
  3. Eduard Gabdulkhakov 2013-01-23

    Hi Mauro, Could you please help me to understand this issue on Android device? When application is resumed after being in background ('pause' -state) for appr. 20 minutes it will crash with same error. 01-22 19:37:11.165 E/TiApplication(25605): (main) [153,1980] Sending event: exception on thread: main msg:java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.app.test/com.example.app.test.TestActivity}: 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.0.0,2012/12/12 18:49,a5894b3 01-22 19:37:11.165 E/TiApplication(25605): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.app.test/com.example.app.test.TestActivity}: 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. 01-22 19:37:11.165 E/TiApplication(25605): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1967) 01-22 19:37:11.165 E/TiApplication(25605): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1992) 01-22 19:37:11.165 E/TiApplication(25605): at android.app.ActivityThread.access$600(ActivityThread.java:127) 01-22 19:37:11.165 E/TiApplication(25605): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1158) 01-22 19:37:11.165 E/TiApplication(25605): at android.os.Handler.dispatchMessage(Handler.java:99) 01-22 19:37:11.165 E/TiApplication(25605): at android.os.Looper.loop(Looper.java:137) 01-22 19:37:11.165 E/TiApplication(25605): at android.app.ActivityThread.main(ActivityThread.java:4511) 01-22 19:37:11.165 E/TiApplication(25605): at java.lang.reflect.Method.invokeNative(Native Method) 01-22 19:37:11.165 E/TiApplication(25605): at java.lang.reflect.Method.invoke(Method.java:511) 01-22 19:37:11.165 E/TiApplication(25605): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:980) 01-22 19:37:11.165 E/TiApplication(25605): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:747) 01-22 19:37:11.165 E/TiApplication(25605): at dalvik.system.NativeStart.main(Native Method) 01-22 19:37:11.165 E/TiApplication(25605): 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. 01-22 19:37:11.165 E/TiApplication(25605): at android.view.View.onRestoreInstanceState(View.java:10169) 01-22 19:37:11.165 E/TiApplication(25605): at android.view.View.dispatchRestoreInstanceState(View.java:10145) 01-22 19:37:11.165 E/TiApplication(25605): at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:2329) 01-22 19:37:11.165 E/TiApplication(25605): at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:2329) 01-22 19:37:11.165 E/TiApplication(25605): at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:2329) 01-22 19:37:11.165 E/TiApplication(25605): at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:2329) 01-22 19:37:11.165 E/TiApplication(25605): at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:2329) 01-22 19:37:11.165 E/TiApplication(25605): at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:2329) 01-22 19:37:11.165 E/TiApplication(25605): at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:2329) 01-22 19:37:11.165 E/TiApplication(25605): at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:2329) 01-22 19:37:11.165 E/TiApplication(25605): at android.view.View.restoreHierarchyState(View.java:10123) 01-22 19:37:11.165 E/TiApplication(25605): at com.android.internal.policy.impl.PhoneWindow.restoreHierarchyState(PhoneWindow.java:1752) 01-22 19:37:11.165 E/TiApplication(25605): at android.app.Activity.onRestoreInstanceState(Activity.java:906) 01-22 19:37:11.165 E/TiApplication(25605): at android.app.Activity.performRestoreInstanceState(Activity.java:878) 01-22 19:37:11.165 E/TiApplication(25605): at android.app.Instrumentation.callActivityOnRestoreInstanceState(Instrumentation.java:1103) 01-22 19:37:11.165 E/TiApplication(25605): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1945) 01-22 19:37:11.165 E/TiApplication(25605): ... 11 more Thank you, Eduard

JSON Source