raamcosta / compose-destinations

Annotation processing library for type-safe Jetpack Compose navigation with no boilerplate.
https://composedestinations.rafaelcosta.xyz
Apache License 2.0
3.23k stars 134 forks source link

Error in multimodule v2 NavHostGraph #677

Closed davisoqt closed 2 months ago

davisoqt commented 2 months ago

I have a profile module with a few destinations. Inside that module i create @NavGraph<ExternalModuleGraph> internal annotation class ProfileGraph then in app module i create a
`@NavGraph internal annotation class ProfileGraph @NavHostGraph annotation class MainGraph {

@ExternalNavGraph<ProfileNavGraph>(start = true)
companion object Includes

}`

When i create the DestinationsNavHost( modifier = Modifier.fillMaxSize(), navGraph = MainGraph, navController = navController ) i get these error Type mismatch. Required: NavHostGraphSpec /* = TypedNavHostGraphSpec<*> */ Found: MainGraph.Includes

raamcosta commented 2 months ago

You’ll want to pass the generated NavGraph, not your annotation class. Probably MainNavGraph or NavGraphs.root.

raamcosta commented 2 months ago

I'll assume this is solved!