-
-
Notifications
You must be signed in to change notification settings - Fork 161
Description
When using the KMP ViewModels (org.jetbrains.androidx.lifecycle:lifecycle-viewmodel-compose
) version 2.9.0, it uses the SavedState (androidx.savedstate:savedstate
) version 1.3.0, which has breaking changes with 1.2.0. Using ViewModel 2.8.4 still works fine.
Error
java.lang.NoSuchMethodError: 'void androidx.savedstate.SavedStateRegistryController.performRestore(androidx.core.bundle.Bundle)'
at cafe.adriel.voyager.jetpack.VoyagerLifecycleKMPOwner.onCreate(VoyagerLifecycleKMPOwner.kt:90)
at cafe.adriel.voyager.jetpack.VoyagerLifecycleKMPOwner.LifecycleDisposableEffect$voyager_lifecycle_kmp(VoyagerLifecycleKMPOwner.kt:172)
at cafe.adriel.voyager.jetpack.ScreenLifecycleKMPOwner$ProvideBeforeScreenContent$1.invoke(ScreenLifecycleJetpackOwner.kt:21)
at cafe.adriel.voyager.jetpack.ScreenLifecycleKMPOwner$ProvideBeforeScreenContent$1.invoke(ScreenLifecycleJetpackOwner.kt:20)
at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.kt:121)
at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.kt:51)
at androidx.compose.runtime.CompositionLocalKt.CompositionLocalProvider(CompositionLocal.kt:384)
at androidx.compose.runtime.saveable.SaveableStateHolderImpl.SaveableStateProvider(SaveableStateHolder.kt:79)
Ideas
I noticed some changes in the public API parameters:
Saved State 1.3.0 - https://github.com/JetBrains/compose-multiplatform-core/blob/jb-main/savedstate/sa[…]/androidx/savedstate/SavedStateRegistryController.nonAndroid.kt
Saved State 1.2.0 - https://github.com/JetBrains/compose-multiplatform-core/blob/6ff110c6f6a7635ab89a7[…]Main/kotlin/androidx/savedstate/SavedStateRegistryController.kt
Reproducer
https://github.com/faogustavo/VoyagerIssueReproducer
To reproduce the problem, just run the tests from the ComposeAppCommonTest
class.