Getting this error when I upgrade to navigation-co...
# compose
j
Getting this error when I upgrade to navigation-compose 2.4.0-alpha05
java.lang.ClassCastException: androidx.navigation.NavGraph cannot be cast to androidx.navigation.compose.ComposeNavigator$Destination
This happens when I try to navigate
Copy code
navController.navigate(Screen.Authentication.route) {
    popUpTo(Screen.Main.route) {
        inclusive = true
    }
    launchSingleTop = true
}
Worked fine with 04
j
I encountered this issue too after upgrading. I hope that having a read at : https://kotlinlang.slack.com/archives/CJLTWPH7S/p1627021681327100 and: https://kotlinlang.slack.com/archives/CJLTWPH7S/p1627021681327100 will offer some food for thought and hints at some workarounds.
j
I haven't found a workaround as yet
j
My hunch is that your call to navigate is now being called multiple times.
Have you tried wrapping it in a LaunchedEffect ?
j
Looks like this will be fixed in alpha6 https://issuetracker.google.com/issues/194301889
j
Nice. I can't wait.
When is alpha6 coming out?
j
It's out now
j
Nice. It doesn't crash anymore