Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Two views has same id error #31

Open
smhdk opened this issue Feb 12, 2021 · 8 comments
Open

Two views has same id error #31

smhdk opened this issue Feb 12, 2021 · 8 comments
Labels
help wanted Extra attention is needed

Comments

@smhdk
Copy link

smhdk commented Feb 12, 2021

Hi,
The following error is occurring.

Fatal Exception: java.lang.IllegalArgumentException
Wrong state class, expecting View State but received class androidx.recyclerview.widget.RecyclerView$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/rv_popular_show. Make sure other views do not use the same id.

@dew-achlesh
Copy link

Hi,
Getting the following error for all RecyclerView implementation after adding this library.
`View.java line

Caused by java.lang.IllegalArgumentException
Wrong state class, expecting View State but received class androidx.recyclerview.widget.RecyclerView$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/recyclerToday. Make sure other views do not use the same id.`

@ericktijerou
Copy link
Owner

Hi @smhdk @AchleshK

Sorry for the late reply.

I couldn't reproduce this issue. Can you please provide more information about your code?

Thank you for your feedback. It is appreciated.

@ericktijerou ericktijerou added the help wanted Extra attention is needed label Aug 3, 2021
@ghost
Copy link

ghost commented May 5, 2022

Same issue here.
Just call loadSkeleton() method on a recyclerView in FragmentA. navigate from FragmentA to FragmentB. and then when press back button to come back to FragmentA, this exception occures.
Please tell me if you need more info

@jaelson-wagner
Copy link

I'm getting the same error. The scenario is the same as reported by @babak-gholampour.

@mdrlzy
Copy link

mdrlzy commented Sep 9, 2022

Found workaround: add android:saveEnabled="false" to RecyclerView

@vullnetlimani
Copy link

This is happening in BottomNavigationView as well and when you change the theme, so a recreation happens the issue occurs there as well.

@sevaktahmazyan
Copy link

Same issue with same behavior.

@Kaunain26
Copy link

Kaunain26 commented May 4, 2024

when screen recreates then we are facing this problem. This is very serious bug. I tried all the workaround but it failed. I tried to assign the View id programatically at runtime but this was a temporary solution. Requesting the @ericktijerou author to fix this otherwise this library is not usefull to anyone since in production app crashing a lot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

8 participants