utsmannn / osm-android-compose

OpenStreetMap android for compose

Home Page:https://utsmannn.github.io/osm-android-compose/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error When Navigation Back

alek43 opened this issue · comments

commented

Haloo utsmann, i have try your lib, but i got some error, when i got back requested after load the maps the apps force closing.

commented

java.lang.IllegalStateException: Check failed.
at androidx.compose.runtime.saveable.SaveableStateRegistryImpl.performSave(SaveableStateRegistry.kt:138)
at androidx.compose.runtime.saveable.SaveableStateHolderImpl$RegistryHolder.saveTo(SaveableStateHolder.kt:125)
at androidx.compose.runtime.saveable.SaveableStateHolderImpl$SaveableStateProvider$1$1$invoke$$inlined$onDispose$1.dispose(Effects.kt:484)
at androidx.compose.runtime.DisposableEffectImpl.onForgotten(Effects.kt:85)

The issue is with rememberOverlayManagerState.

DefaultOverlayManager is not savable into a bundle.

Use the following alternative.

 rememberSaveable(key = null, saver = Saver(
				save = {
					   null
				},
				restore = {
					OverlayManagerState(null)
				}
			)) {
				OverlayManagerState(null)
			}

Or just do not use this library.
It is not maintained, and is not recommended for any production code.