vicky7230
04/20/2026, 4:26 PMFatal Exception: java.lang.IllegalArgumentException: No destination with route landing is on the NavController's back stack. The current destination is Destination(0x41295e74) route=neo_activation/{neoLaunchModeArg}/{neoTripIdArg}
at androidx.navigation.NavController.getBackStackEntry(NavController.kt:2230)
This is the code:
fun NavGraphBuilder.neoBookingScreen(navController: NavController, onBackClick: () -> Unit) {
composable(route = neoBookingRoute) { entry ->
val neoViewModel: NeoViewModel = entry.sharedViewModel(navController)
NeoBookingScreenRoute(neoViewModel = neoViewModel, onBack = onBackClick)
}
}
@Composable
inline fun <reified T : ViewModel> NavBackStackEntry.sharedViewModel(
navController: NavController
): T {
val navGraphRoute = destination.parent?.route ?: return hiltViewModel()
val pareEntry = remember(this) { navController.getBackStackEntry("landing") }
return hiltViewModel(pareEntry)
}
I am not able to find the root cause here. we are using androidx.navigation:navigation-compose 2.5.3 herevicky7230
04/20/2026, 4:29 PMvicky7230
04/21/2026, 5:37 AMJack Boswell
04/21/2026, 5:55 AMvicky7230
04/21/2026, 5:56 AMJack Boswell
04/21/2026, 5:57 AMlanding in your backstack, so when you call getBackStackEntry looking for route landing it throws an exceptionJack Boswell
04/21/2026, 5:59 AMlanding isn't in your backstack based on the code you shared, that'd be something worth looking intovicky7230
04/21/2026, 6:00 AMvicky7230
04/21/2026, 6:01 AMlanding in backstack, but it is not possible to navigate to the neo_activation screen without landing .vicky7230
04/21/2026, 6:02 AMJack Boswell
04/21/2026, 6:05 AMJack Boswell
04/21/2026, 6:06 AMlanding route isn't on the backstack based on the code you shared, but it's a fact that it's not thereJack Boswell
04/21/2026, 6:07 AMlanding is a route on a different nav controller, or because it was popped from the backstack when navigating, or maybe it was never there to start with. There's not enough information in your post to narrow it downJack Boswell
04/21/2026, 6:07 AMChrimaeon
04/21/2026, 7:06 PM• Please do not ping or mention someone directly to get your questions answered, especially project owners, whether the project is Kotlin or other, unless they specifically indicate that you can.https://kotlinlang.org/docs/slack-code-of-conduct.html#basic-usage-guidelines
vicky7230
04/22/2026, 4:42 AM