albrechtroehm
09/17/2024, 11:45 AMjava.lang.IllegalArgumentException: navigation destination multi_step_checkout_screen is not a direct child of this NavGraph
Nothing else was changed and if go back to 1.10.2 it still works as expected. Here is the code in the MainActivity where i set the DestinationsNavHost according to whether the app was called with some paymentMetadata or not. I also only have one NavGraph defined.
Code in the threadalbrechtroehm
09/17/2024, 11:46 AM@OptIn(KoinExperimentalAPI::class)
@Composable
fun App(paymentMetadata: PaymentMetadata? = null) {
KoinAndroidContext {
WalletAppTheme {
Surface(color = MaterialTheme.colorScheme.background) {
val navHostEngine = rememberNavHostEngine(
rootDefaultAnimations = RootNavGraphDefaultAnimations.ACCOMPANIST_FADING,
)
if (paymentMetadata == null) {
DestinationsNavHost(
navGraph = NavGraphs.root,
engine = navHostEngine,
)
} else {
DestinationsNavHost(
navGraph = NavGraphs.root,
engine = navHostEngine,
startRoute = MultiStepCheckoutScreenDestination,
) {
composable(MultiStepCheckoutScreenDestination) {
MultiStepCheckoutScreen(paymentMetadata)
}
}
}
}
}
}
}
with this NavGraphs
/**
* Class generated if any Composable is annotated with `@Destination`.
* It aggregates all [TypedDestination]s in their [NavGraph]s.
*/
public object NavGraphs {
public val root: NavGraph = NavGraph(
route = "root",
startRoute = WelcomeScreenDestination,
destinations = listOf(
ChargeScreenDestination,
WelcomeScreenDestination,
CheckoutScreenDestination,
MultiStepCheckoutScreenDestination
)
)
}
Anyone maybe has some idea what is going wrong here?Robert C
09/18/2024, 10:45 AMalbrechtroehm
09/19/2024, 11:59 AMRafael Costa
09/21/2024, 12:33 PMSonu Sourav
10/10/2024, 5:43 AMSonu Sourav
10/10/2024, 5:43 AMRafael Costa
10/10/2024, 7:32 AMSonu Sourav
10/10/2024, 7:47 AMRafael Costa
10/10/2024, 8:06 AMRafael Costa
10/10/2024, 8:07 AMRafael Costa
10/10/2024, 8:08 AMRafael Costa
10/10/2024, 8:08 AMRobert C
10/10/2024, 9:01 AMRafael Costa
10/10/2024, 9:35 AMRafael Costa
10/10/2024, 9:35 AM