-
-
Notifications
You must be signed in to change notification settings - Fork 132
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Nested Graph Problem #573
Comments
Can you paste the stack trace of the exception please? |
Why is WelcomeScreen itself a Destination? 🙃 You have a destination which is the start of Root graph and then it calls DestinationsNavHost passing Root graph, which then would have another NavHost and on and on? The place where you call DestinationsNavHost cannot it self be a destination that belongs to the graph your passing to that NavHost. |
Oh my bad i copied the first snippet of code wrong. It's supossed to look like this @AndroidEntryPoint
class MainActivity : ComponentActivity() {
@OptIn(ExperimentalMaterialNavigationApi::class, ExperimentalAnimationApi::class)
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContent {
val navHostEngine = rememberAnimatedNavHostEngine(
navHostContentAlignment = Alignment.TopCenter,
rootDefaultAnimations = RootNavGraphDefaultAnimations.ACCOMPANIST_FADING,
defaultAnimationsForNestedNavGraph = mapOf(
NavGraphs.root to NestedNavGraphDefaultAnimations(
enterTransition = { slideInHorizontally() },
exitTransition = { slideOutHorizontally() }
),
))
val navController = rememberNavController()
DestinationsNavHost(navGraph = NavGraphs.root, engine = navHostEngine, navController = navController)
}
}
} And this is the welcome screen which is start. @RootNavGraph(start = true)
@Destination
@Composable
fun WelcomeScreen(
navController: DestinationsNavigator
) {
(content of welcome screen)
} |
And heres the stack trace.
However this is only one of the stack traces as theres so many of them that the start gets overwritten and is inaccessible. |
Me closing this issue was accidental, this is my first issue so i don't really know what im doing. |
I don't see in the stack trace, anything related with this library, so I'm closing this. Let me know if I can help any further. |
This is the welcome screen of our app
And this is the content of our app and we have a problem. Whenever we try to navigate between NavGraphs it stops the app and after 6-7 seconds we get a android runtime exception and a ton of errors.
But if we remove DestinationsNavHost it navigates normally to MainNavGraph.
The text was updated successfully, but these errors were encountered: