I have another question <@U0234N0QYSK> I have a n...
# compose-destinations
s
I have another question @Rafael Costa I have a navGraph on the App side with no destinations of its own! And i want to attach external destinations from another module But the issue im facing is that no code is being generated for the app graph which doesnt actually have its own app-side destinations, only lib side
r
This should be working. Wanna show me how you’re doing it?
s
Let me get you some code of the setup
//App Module
Copy code
@NavHostGraph(
    defaultTransitions = DefaultFadingTransitions::class,
    visibility = CodeGenVisibility.INTERNAL
)
annotation class HomeGraph

@NavGraph<HomeGraph>(
    defaultTransitions = DefaultFadingTransitions::class,
    visibility = CodeGenVisibility.INTERNAL
)
annotation class ExternalFeatureGraph {
    @ExternalDestination<ScreenOneDestination>
    @ExternalDestination<ScreenTwoDestination>
    companion object Includes
}
//External Module
Copy code
@Destination<ExternalModuleGraph>
@Composable
fun ScreenOne() {
    Box(modifier = Modifier.fillMaxSize(), contentAlignment = Alignment.Center) {
        Text(text = "Screen1 from external module")
    }
}

@Destination<ExternalModuleGraph>
@Composable
fun ScreenTwo() {
    Box(modifier = Modifier.fillMaxSize(), contentAlignment = Alignment.Center) {
        Text(text = "Screen2 from external module")
    }
}
@Rafael Costa
r
Are you passing HomeNavGraph to your DestinationsNavHost? And are you using the NavController same that you also are passing to it?
If yes, can you try including the destinations directly on HomeNavGraph? Just to see if that would work?
Can you show me generated NavGraphs file with its kdocs included?
s
Yes i'm doing all the above mentioned. As mentioned in the OP message, if we have an AppSide destination in the same NavGraph or NavHostGraph the graph gets generated. If we are creating a NavGraph on the AppSide using only external destinations then code is not generated.
r
What version are you using? 🤔
s
Copy code
composeDestinations = "2.0.0-beta01"
r
Can you try to update to beta12?
s
Gradle and latest compose compatibility issues 😅 Many breaking changes but it is planned in the near future
r
2.0.0 should be using the same version of compose regardless of beta number
s
Let me try that Some of the libraries that i use, their latest versions were transitively updating my other libraries like compose-bom
r
Im pretty sure ive fixed this issue after beta01
If you check release notes on GitHub you’ll find in which version and you can use that version if beta12 is not working for you
s
Will get back to you once i confirm the issue as fixed. Thanks a lot Also it would be great if you could reply to my previous queries
It has fixed the issue Thanks
👍 1