My nav graph
composable(route = Screen.HomeScreen.route){
navigateToProfileScreen = { userId: String, userName: String, userAddress: String, userPhone: String, userProfileImage: String ->
navController.navigate(
Screen.ProfileScreen.withArgs
(
userId,userName,userAddress,userPhone,userProfileImage
))
composable(
route = Screen.ProfileScreen.route "/{userProfileId}/{userProfileName}/{userProfileAddress}/{userProfilePhone}/{CurrentUserProfileImage}",
arguments = listOf(
navArgument(name = "userProfileId"){
type = NavType.StringType
},
navArgument(name = "userProfileName"){
type = NavType.StringType
},
navArgument(name = "userProfileAddress"){
type = NavType.StringType
},
navArgument(name = "userProfilePhone"){
type = NavType.StringType
},
navArgument(name = "CurrentUserProfileImage"){
type = NavType.StringType
}
),
enterTransition = { _, _ ->
slideIntoContainer(
AnimatedContentScope.SlideDirection.Right,
animationSpec = tween(500)
)
},
exitTransition = { _, _ ->
slideOutOfContainer(
AnimatedContentScope.SlideDirection.Left,
animationSpec = tween(500)
)
}
) { entry ->
UserProfile(userId = entry.arguments!!.getString("userProfileId")!!,
userName = entry.arguments!!.getString("userProfileName")!!,
userAddress = entry.arguments!!.getString("userProfileAddress")!!,
userPhone = entry.arguments!!.getString("userProfilePhone")!!,
userProfileImage = entry.arguments!!.getString("CurrentUserProfileImage")!!,
navigateBack = { navController.popBackStack() })
}
Error Line Navigation destination that matches request NavDeepLinkRequest{ uri=android-app://androidx.navigation/profile_screen/FBk4Nwq2/Ahmed /Cairo /01319/https://firebasestorage.googleapis03 } cannot be found in the navigation graph NavGraph(0x0) startDestination={Destination(0x442b361f) route=home_screen}
CodePudding user response:
Before passing an URL as an argument you must encode it, like this:
URLEncoder.encode(YOUR_URL, StandardCharsets.UTF_8.toString())