osm-android-compose icon indicating copy to clipboard operation
osm-android-compose copied to clipboard

Error When Navigation Back

Open alek43 opened this issue 2 years ago • 2 comments

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.

alek43 avatar Jul 11 '23 01:07 alek43

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)

alek43 avatar Jul 11 '23 02:07 alek43

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.

Doomsdayrs avatar Dec 07 '23 03:12 Doomsdayrs