Ondřej Kycelt
04/11/2024, 4:58 AMnavController.clearBackStack(route)
? I have a bottom nav bar integration set up as in (https://developer.android.com/develop/ui/compose/navigation#bottom-nav) and I'm trying to clear saved states when logging out. Each tab has its own child graph and I'm passing the child graph's route as a parameter to clearBackStack()
. The crash only happens for the first tab if other tab is currently active and there was some other destination in the back stack when navigating away from the first tab.
java.lang.IllegalStateException: Restore State failed: destination 235168010 cannot be found from the current destination Destination(0x9833407b) route=library/account
at androidx.navigation.NavController.instantiateBackStack(NavController.kt:2036)
at androidx.navigation.NavController.restoreStateInternal(NavController.kt:1945)
at androidx.navigation.NavController.restoreStateInternal(NavController.kt:1953)
at androidx.navigation.NavController.clearBackStackInternal(NavController.kt:826)
at androidx.navigation.NavController.clearBackStack(NavController.kt:785)
Ondřej Kycelt
08/08/2024, 12:13 PM