You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
We are getting some errors, after upgrading to Koin 3.2.1.
Fatal Exception: java.lang.RuntimeException Unable to destroy activity {com.e*.***/com.e*.***.ui.main.MainActivity}: java.lang.IllegalArgumentException: SavedStateProvider with the given key is already registered androidx.savedstate.SavedStateRegistry.registerSavedStateProvider (SavedStateRegistry.kt:110) androidx.lifecycle.ViewModelProvider.get (ViewModelProvider.kt:153) org.koin.androidx.viewmodel.ViewModelResolverKt.resolveInstance (ViewModelResolver.kt:15) org.koin.androidx.viewmodel.scope.ScopeExtKt.getViewModel (ScopeExt.kt:67) org.koin.androidx.viewmodel.scope.ScopeExtKt.getViewModel (ScopeExt.kt:53) org.koin.androidx.viewmodel.scope.ScopeExtKt.getViewModel$default (ScopeExt.kt:45) org.koin.androidx.viewmodel.ext.android.FragmentExtKt.getSharedViewModel (FragmentExt.kt:59) com.e*.***.ui.contentList.ContentListFragment$special$$inlined$sharedViewModel$default$8.invoke (FragmentExt.kt:61) com.e*.***.ui.contentList.ContentListFragment$special$$inlined$sharedViewModel$default$8.invoke (FragmentExt.kt:39) kotlin.UnsafeLazyImpl.getValue (Lazy.kt:81) com.e*.***.ui.contentList.ContentListFragment.getExamFilesViewModel (ContentListFragment.kt53) com.e*.***.ui.contentList.ContentListFragment.resetAllFilters (ContentListFragment.kt:201) com.e*.***.ui.contentList.ContentListFragment.onDestroy (ContentListFragment.kt:449)
To Reproduce
Despite our best efforts, we have not been able to reproduce the issue.
Expected behavior
The app should not crash.
Koin project used and used version (please complete the following information): implementation "io.insert-koin:koin-android:3.2.1" implementation "io.insert-koin:koin-annotations:1.0.2" ksp "io.insert-koin:koin-ksp-compiler:1.0.2"
Additional moduleDefinition
Usage of viewModel: private val examFilesViewModel: ExamFilesViewModel by sharedViewModel()
The text was updated successfully, but these errors were encountered:
marekdef
pushed a commit
to marekdef/InsertKoinSharedViewModel
that referenced
this issue
Oct 5, 2022
I have similar issue, with koin 3.2.0.
What I was trying to do was to create a Fragment that contain 3 subfragments and I want to share viewModel with them.
Describe the bug
We are getting some errors, after upgrading to
Koin 3.2.1
.Fatal Exception: java.lang.RuntimeException Unable to destroy activity {com.e*.***/com.e*.***.ui.main.MainActivity}: java.lang.IllegalArgumentException: SavedStateProvider with the given key is already registered androidx.savedstate.SavedStateRegistry.registerSavedStateProvider (SavedStateRegistry.kt:110) androidx.lifecycle.ViewModelProvider.get (ViewModelProvider.kt:153) org.koin.androidx.viewmodel.ViewModelResolverKt.resolveInstance (ViewModelResolver.kt:15) org.koin.androidx.viewmodel.scope.ScopeExtKt.getViewModel (ScopeExt.kt:67) org.koin.androidx.viewmodel.scope.ScopeExtKt.getViewModel (ScopeExt.kt:53) org.koin.androidx.viewmodel.scope.ScopeExtKt.getViewModel$default (ScopeExt.kt:45) org.koin.androidx.viewmodel.ext.android.FragmentExtKt.getSharedViewModel (FragmentExt.kt:59) com.e*.***.ui.contentList.ContentListFragment$special$$inlined$sharedViewModel$default$8.invoke (FragmentExt.kt:61) com.e*.***.ui.contentList.ContentListFragment$special$$inlined$sharedViewModel$default$8.invoke (FragmentExt.kt:39) kotlin.UnsafeLazyImpl.getValue (Lazy.kt:81) com.e*.***.ui.contentList.ContentListFragment.getExamFilesViewModel (ContentListFragment.kt53) com.e*.***.ui.contentList.ContentListFragment.resetAllFilters (ContentListFragment.kt:201) com.e*.***.ui.contentList.ContentListFragment.onDestroy (ContentListFragment.kt:449)
To Reproduce
Despite our best efforts, we have not been able to reproduce the issue.
Expected behavior
The app should not crash.
Koin project used and used version (please complete the following information):
implementation "io.insert-koin:koin-android:3.2.1" implementation "io.insert-koin:koin-annotations:1.0.2" ksp "io.insert-koin:koin-ksp-compiler:1.0.2"
Additional moduleDefinition
Usage of viewModel:
private val examFilesViewModel: ExamFilesViewModel by sharedViewModel()
The text was updated successfully, but these errors were encountered: