brickkit-android
brickkit-android copied to clipboard
Crash when destroying BrickDataManager
There is an intermittent exception happening when fragments are destroyed
Fatal Exception: java.lang.IllegalStateException
Observer androidx.recyclerview.widget.RecyclerView$x@2e03f6b was not registered.
android.database.Observable.unregisterObserver (Observable.java:69)
androidx.recyclerview.widget.RecyclerView.setAdapter (RecyclerView.java:1194)
com.wayfair.brickkit.BrickDataManager.onDestroyView (BrickDataManager.kt:399)
the issue appears to be right here.
https://github.com/wayfair/brickkit-android/blob/131ebd3c0e7a85e847e11d3559dd6229dc997396/BrickKit/bricks/src/main/java/com/wayfair/brickkit/BrickDataManager.kt#L399
Since this is a destroy step anyways, the best course of action might be to just catch the exception.
Agreed, looks like it'll be painful to get to the bottom of, and might be an Android ver specific change? The few versions of recyclerView.setAdapter that I checked weren't even calling unregisterObserver
Betting this is a Samsung issue :>