Change theme
Help
Press space for more information.
Show links for this issue (Shortcut: i, l)
Copy issue ID
Previous Issue (Shortcut: k)
Next Issue (Shortcut: j)
Sign in to use full features.
Vote: I am impacted
Notification menu
Refresh (Shortcut: Shift+r)
Go home (Shortcut: u)
Use Markdown for this comment
Set severity, which reflects how much the issue affects the use of the product
Change issue status back to 'Assigned'
Pending code changes (auto-populated)
[ID: 84651]
Story points rate the relative effort of work in a Fibonacci-like format: 0, 0.5, 1, 2, 3, 5, 8, 13, 20, 40, 100. Each team will estimate work on a slightly different scale, which means the values in this field are likely only meaningful to the team that owns the Buganizer component in which the issue resides.
See Atlassian's Agile Coach for more information on how to use story points for estimation: https://www.atlassian.com/agile/project-management/estimation [ID: 746686]
Set the version(s) of the product affected by this issue (comma-separated list)
Set the version(s) of the product in which the issue should be fixed (comma-separated list)
Set the version(s) of the product in which the issue fix was verified (comma-separated list)
Set if this issue occurs in production
[ID: 85206]
Set Reporter
Set Type
Set priority, which reflects how soon the issue should be fixed
Set Status
Set Assignee
Set Verifier
Remove item
View or edit staffing
View issue level access limits(Press Alt + Right arrow for more information)
Description
#1Version used: 2.2.0-rc03
Devices/Android versions reproduced on: can't reproduce
I have a few crash reports about this exceptions, that I can't reproduce in normal conditions and I wonder if this is some corner-case bug.
Stacktrace:
Fatal Exception: java.lang.IllegalStateException: unknown destination during deep link: com.app:id/nav_graph_main
at androidx.navigation.NavController.handleDeepLink(NavController.java:660)
at androidx.navigation.NavController.onGraphCreated(NavController.java:573)
at androidx.navigation.NavController.setGraph(NavController.java:534)
at androidx.navigation.NavController.setGraph(NavController.java:514)
at com.app.view.HomeFragment.prepareNestedNavHost(HomeFragment.java:65)
at com.app.view.HomeFragment.onViewCreated(HomeFragment.java:50)
at androidx.fragment.app.FragmentStateManager.createView(FragmentStateManager.java:304)
at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1227)
at androidx.fragment.app.FragmentManager.addAddedFragments(FragmentManager.java:2373)
at androidx.fragment.app.FragmentManager.executeOpsTogether(FragmentManager.java:2108)
at androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute(FragmentManager.java:2064)
at androidx.fragment.app.FragmentManager.execPendingActions(FragmentManager.java:1960)
at androidx.fragment.app.FragmentManager$4.run(FragmentManager.java:418)
I have a main NavHostFragment, hosted in my MainActivity, that owns the "nav_graph_main" graph.
HomeFragment is a destination of "nav_graph_main" and it contains a second NavHost (the "nested" NavHost) to manage navigation between several subscreens together with a BottomNavigationBar (HomeFragment's layout is a NavHostFragment above a BottomNavigatonBar).
The graph of the "nested" navigation ("nav_graph_home") is a separate resource, with no link to the outer "nav_graph_main" graph.
I need to programmatically set the nested graph to the nested NavController, because the start destination practically depends on which bottom navigation tab I want to be selected first.
Therefore, in HomeFragment's onViewCreated, I call the following prepareNestedNavHost:
fun prepareNestedNavHost() {
val startDestination = args.startDestination
val navHostFragment = childFragmentManager.findFragmentById(R.id.navHostHome) as? NavHostFragment
navHostFragment?.navController?.apply {
// I have no other way to know if the graph is not set:
kotlin.runCatching { this.graph }.onFailure {
val nestedGraph = navInflater.inflate(R.navigation.nav_graph_home)
graph.startDestination = startDestination
this.graph = nestedGraph
}
}
}
The only potential reason that came out of my mind is that the nested NavController, sharing the same Activity with the outer NavController, might end up handling an Intent directed to the latter. Is this working as intended?