Trying to integrate this bottom tab code into a ne...
# compose-android
c
Trying to integrate this bottom tab code into a new material3 app https://developer.android.com/develop/ui/compose/navigation#bottom-nav Getting this error
NavDestination. hasRoute can only be called from within the same library group (referenced groupId=androidx. navigation from
on this code
Copy code
selected = currentDestination?.hierarchy?.any { it.hasRoute(topLevelRoute.route::class) } == true,
Am I missing something?
c
check your imports and dep version.
NavDestinat*ion.hasRoute*(route: KClass<T>)
in not “Internal” https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:navigati[…]l=844?q=androidx.navigation.NavDestination.Companion.hasRoute
c
hm:
Copy code
composeBom = "2024.09.03"
navigationCompose = "2.8.2"
these deps seem up to date
c
why do i feel like i step away from compose for like 3 months and i miss something obvious. lol
hm. maybe it was just the import. deleted the hasRoute line and wrote it out again and everything worked this time. 🙃
thanks for the sanity check @Chrimaeon
👍🏼 1
i
Here's the relevant Lint issue (it is actually a K2 issue): https://issuetracker.google.com/issues/372175033
👌 1
c
Nice! glad i wasn't going crazy
289 Views