Deepak Gahlot
01/11/2022, 7:35 AMjava.lang.IllegalArgumentException: SavedStateProvider with the given key is already registered
at androidx.savedstate.SavedStateRegistry.registerSavedStateProvider(SavedStateRegistry.java:111)
at androidx.lifecycle.SavedStateHandleController.attachToLifecycle(SavedStateHandleController.java:50)
at androidx.lifecycle.SavedStateHandleController.create(SavedStateHandleController.java:70)
at androidx.lifecycle.SavedStateViewModelFactory.create(SavedStateViewModelFactory.java:115)
at androidx.lifecycle.ViewModelProvider.get(ViewModelProvider.kt:169)
at androidx.lifecycle.ViewModelProvider.get(ViewModelProvider.kt:139)
at androidx.lifecycle.viewmodel.compose.ViewModelKt.get(ViewModel.kt:87)
at androidx.lifecycle.viewmodel.compose.ViewModelKt.viewModel(ViewModel.kt:72)
at androidx.navigation.compose.NavBackStackEntryProviderKt.SaveableStateProvider(NavBackStackEntryProvider.kt:86)
at androidx.navigation.compose.NavBackStackEntryProviderKt.access$SaveableStateProvider(NavBackStackEntryProvider.kt:1)
at androidx.navigation.compose.NavBackStackEntryProviderKt$LocalOwnersProvider$1.invoke(NavBackStackEntryProvider.kt:51)
at androidx.navigation.compose.NavBackStackEntryProviderKt$LocalOwnersProvider$1.invoke(NavBackStackEntryProvider.kt:50)
I'm getting this exception when i launch an
rememberLauncherForActivityResult(
ActivityResultContracts.OpenDocument()
Attach a file and click on one of the button which triggers an action to go to a previous screen in the navigation graph using the Navigate.up() function. Any thoughts on what could be causing this. If any more info is indeed please let me know.Colton Idle
01/11/2022, 3:41 PMDeepak Gahlot
01/11/2022, 3:47 PMjava.lang.IllegalStateException: ViewModelStore should be set before setGraph call
This Exception is coming as soon i return to the app after selecting the documentColton Idle
01/12/2022, 6:22 PM