Giovanni Marques
10/17/2025, 6:12 PMorg.jetbrains.androidx.navigation:navigation-compose:2.9.1), but when I can’t get the safe args to work. I’m trying to implement something similar to this: https://medium.com/androiddevelopers/navigation-compose-meet-type-safety-e081fb3cf2f8 🧵Giovanni Marques
10/17/2025, 6:14 PMNavHost(
navController = navController,
startDestination = NavigationDestination.Home,
modifier = Modifier.weight(1f)
) {
...
composable<Search>(
typeMap = mapOf(typeOf<SearchParameters>() to SearchParametersType)
) { backStackEntry ->
val searchParameters = backStackEntry.toRoute<Search>().parameters
Text("Testing: $searchParameters")
}
}
but when I navigate I get
java.lang.IllegalArgumentException: Navigation destination that matches route com.test.compose.Search/{"searchQuery":"test","filters":[""]} cannot be found in the navigation graph ComposeNavGraph(0x0) startDestination={Destination(0x56174464) route=com.test.compose.NavigationDestination.Home}Giovanni Marques
10/17/2025, 6:14 PMtypeMap I get the expected error that it can't find the NavType for argument parameters of type SearchParameters, but if I declare the nav type it opens the app, correctly calls the the methods on my custom NavType, but crashes saying that it couldn’t find the destination when I try to navigateJack Boswell
10/17/2025, 9:29 PMGiovanni Marques
10/20/2025, 10:25 AMput correctly.