Hi I’m trying to integrate facebook ads network vi...
# compose
Hi I’m trying to integrate facebook ads network via Admob mediation to my app But I’ve encountered an error while restoring view state when using
AndroidView(factory: ..)
inside Compose LazyList As a workaround I checked duplicate ids and reset them to random id Error message: IllegalArgumentException: Wrong state class, expecting View State but received class… This usually happens when two views of different type have the same id in the same hierarchy.
You should be able to use
and not rely on random
isn't stable across configuration changes (it is just a static, ever increasing counter that never gives you the same number back), so if you actually want your state restored correctly, you can't use that either
Yeah you would need to persist it; in a rememberSaveable or similar you'd avoid collisions
☝🏼 1
☝️ 3