I've been using the experimental API `AnimatedNavH...
# compose
r
I've been using the experimental API
AnimatedNavHost
and now tried to introduce parameters into my navigation starting with the doc example
arguments = listOf(navArgument("userId") { defaultValue = "me" })
but I get the compiler error "Type mismatch: inferred type is List<androidx.navigation.NamedNavArgument> but List<androidx.navigation.compose.NamedNavArgument> was expected". Does anyone know how to fix this (other than going back to regular
NavHost
, which works)?
a
Accompanist is not yet compatible with Androidx Navigation 2.4.0-alpha09. You need to use 2.4.0-alpha08 for now.
r
Thanks, that works. I do not see that in the usual places I look for release notes -- do you know where that is noted (so I can upgrade at the appropriate time)?
a
https://developer.android.com/jetpack/androidx/releases/navigation#2.4.0-alpha09
The 
navArgument
 Kotlin DSL function is now part of 
navigation-common
 instead of 
navigation-compose
. This will require updating imports to continue to use this function.
r
Thanks. (I'm still new enough at this that I did not correlate that with a specific release.)
c
hm. pretty sure I'm using accompnist 0.17 and nav alpha09 without issues. I'll look into whether I should downgrade. 😅
a
If there's no problem you don't need to bother. The incompatibility only happens when you are using navigation-animation or navigation-material with custom nav arguments.
👍 1