ericktijerou / koleton

The easiest library to show skeleton screens in an Android app.
Apache License 2.0
300 stars 26 forks source link

Two views has same id error #31

Open smhdk opened 3 years ago

smhdk commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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.

ghost commented 2 years ago

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 commented 2 years ago

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

mdrlzy commented 2 years ago

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

vullnetlimani commented 1 year ago

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

sevaktahmazyan commented 1 year ago

Same issue with same behavior.

Kaunain26 commented 4 months ago

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.