compose-destinations
compose-destinations copied to clipboard
java.lang.IllegalStateException: Duplicate route found X_destination'. Routes must be unique!. In Muli-module project.
I have
@Destination<ExternalModuleGraph>
@Composable
fun SettingsDestination() {
...
}
private const val BOTTOM_NAVIGATION_GRAPH = "bottom_navigation_graph"
@NavHostGraph(route = BOTTOM_NAVIGATION_GRAPH)
annotation class BottomNavigationGraph {
@ExternalDestination<SettingsDestinationDestination>()
companion object Includes
}
Also I have graph that belongs to BottomNavigationGraph and has SettingsDestination
private const val X_GRAPH = "x_graph"
@NavGraph<BottomNavigationGraph>(route = X_GRAPH, start = true)
annotation class XGraph {
@ExternalDestination<SettingsDestinationDestination>()
companion object Includes
}
Simple workaround can be like that:
@Destination<ExternalModuleGraph>
@Composable
fun SettingsBottomGraphDestination() {
...
}
@Destination<ExternalModuleGraph>
@Composable
fun SettingsXGraphDestination() {
...
}
In that case I don't receive any benefit of splitting destinations to different modules. Am I missing some API ? May you suggest something ?