深层链接期间未知的目的地

时间:2019-01-07 18:14:31

标签: android android-architecture-navigation

我有一个名为global_graph的以下导航图:

A -> B -> C

所有A,B和C均为片段。在C布局中,我有一个<fragment/>,其属性app:navGraph设置为其他导航图。如果我直接打开该应用程序,则导航没有问题。但是,当我尝试从Deeplink打开它时,每次尝试导航到C时,应用都会崩溃,包括以下所有情况:

  1. 将深层链接目标设置为C
  2. 将深度链接目标设置为AB,然后导航到C。从B导航到C时,应用崩溃了。

以下是错误堆栈跟踪:

Caused by: java.lang.IllegalStateException: unknown destination during deep link: com.example.ltvlu.navitaion_jetpack:id/global_graph
    at androidx.navigation.NavController.handleDeepLink(NavController.java:588)
    at androidx.navigation.NavController.onGraphCreated(NavController.java:488)
    at androidx.navigation.NavController.setGraph(NavController.java:425)
    at androidx.navigation.fragment.NavHostFragment.onCreate(NavHostFragment.java:235)
    at android.support.v4.app.Fragment.performCreate(Fragment.java:2414)
    at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1418)
    at android.support.v4.app.FragmentTransition.addToFirstInLastOut(FragmentTransition.java:1195)
    at android.support.v4.app.FragmentTransition.calculateFragments(FragmentTransition.java:1078)
    at android.support.v4.app.FragmentTransition.startTransitions(FragmentTransition.java:117)
    at android.support.v4.app.FragmentManagerImpl.executeOpsTogether(FragmentManager.java:2408)
    at android.support.v4.app.FragmentManagerImpl.removeRedundantOperationsAndExecute(FragmentManager.java:2366)
    at android.support.v4.app.FragmentManagerImpl.execSingleAction(FragmentManager.java:2243)
    at android.support.v4.app.BackStackRecord.commitNow(BackStackRecord.java:648)

这是我的导航组件依赖项:

    implementation 'android.arch.navigation:navigation-fragment:1.0.0-alpha09'
    implementation 'android.arch.navigation:navigation-ui:1.0.0-alpha09'

我只是想知道这是否是库错误,是否有任何方法可以解决此问题。谢谢!

0 个答案:

没有答案