Declaring two states with the same id was properly erasing the first declared state from the 'states' table of StatefulLayout, but it was not removing its view from the view hierarchy
On my project, I was overloading stateError and I had this crash because of the duplicate :
Wrong state class, expecting View State but received class com.google.android.material.button.MaterialButton$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/stateErrorRetryButton.
Make sure other views do not use the same id.
Duplicates #39 Fixes #52
Declaring two states with the same id was properly erasing the first declared state from the 'states' table of StatefulLayout, but it was not removing its view from the view hierarchy
On my project, I was overloading stateError and I had this crash because of the duplicate :