Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inject SavedStateHandle to ViewModel in KMP Desktop #2036

Open
jvojacek opened this issue Oct 25, 2024 · 1 comment
Open

Inject SavedStateHandle to ViewModel in KMP Desktop #2036

jvojacek opened this issue Oct 25, 2024 · 1 comment
Labels
question Usage question

Comments

@jvojacek
Copy link

Describe the bug
The KMP desktop application crashes when I try to inject SavedStateHandle with navigation arguments to ViewModel. The Android app works fine.
The exception: Caused by: java.lang.IllegalArgumentException: CreationExtras must have a value by SAVED_STATE_REGISTRY_OWNER_KEY

In my composables I initialize the ViewModel using koinNavViewModel().

Am I missing something?

Koin module and version:
koin-android - 4.0.0
koin-androidx-compose - 4.0.0
koin-core - 4.0.0
koin-compose - 4.0.0
koin-compose-viewmodel - 4.0.0
koin-compose-viewmodel-navigation - 4.0.0

org.jetbrains.androidx.navigation:navigation-compose - 2.8.0-alpha10

@arnaudgiuliani
Copy link
Member

SavedStateHandle is not yet ready for full KMP :/

@arnaudgiuliani arnaudgiuliani added the question Usage question label Nov 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Usage question
Projects
None yet
Development

No branches or pull requests

2 participants