Has anybody come across this exception when callin...
# compose
o
Has anybody come across this exception when calling
navController.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.
Copy code
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)
It was a bug https://issuetracker.google.com/issues/339908057, fixed in navigation 2.8.0-beta02