(Android Studio 3.2 Beta) - Navigation Architecture Component Configuration

前提是你 提交于 2019-12-29 08:43:05

问题


I want to try out the new Navigation Architecture Component feature, so I followed this Tutorial: https://www.youtube.com/watch?v=GOpeBbfyb6s.

I am using Android Studio 3.2 Beta 1. I installed the necessary dependencies, but when I try to create the Navigation Android Resource File in the project just like in the video above, the Navigation option does not appear in the selection menu.

My Issue:

There is no Navigation option to select while trying to create the Navigation Android Resource File. Am I missing any steps in the installation?

Expected Result:

My Situation:

My build.gradle

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation"org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
    implementation 'com.android.support:appcompat-v7:27.1.1'
    implementation 'com.android.support.constraint:constraint-layout:1.1.2'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'

    // Navigation Architecture Component Configuration install HERE!!
    def nav_version = "1.0.0-alpha02"

    implementation "android.arch.navigation:navigation-fragment-ktx:$nav_version" // use -ktx for Kotlin
    implementation "android.arch.navigation:navigation-ui-ktx:$nav_version" // use -ktx for Kotlin


}

回答1:


Per this currently open issue:

As per the Help > What's New in Android Studio screen that popped up when you upgraded:

"The Navigation Editor is an experimental feature, so you must first enable it by opening the IDE 'Settings/Preferences' dialog, selecting 'Experiemental' in the left pane, and checking the box next to the 'Enable Navigation Editor'."

We'll update the Navigation documentation to specifically call this out. It will also be enabled by default on future canary builds (of Android Studio 3.3) when available.

So you need to manually enable the Navigation Editor on Beta builds of Android Studio 3.2




回答2:


I have faced same issue when I create new resource file as Navigation Type .

The navigation editor tool is only available in Android Studio 3.2 Canary.

I tried to enable Navigation editor manually: File → Settings → Experimental → Enable Navigation Editor

Still the Navigation option does not appear in the selection menu.

It will appear after I restarted android studio.

Note:I followed this link https://developer.android.com/topic/libraries/architecture/navigation/navigation-implementing



来源:https://stackoverflow.com/questions/50979633/android-studio-3-2-beta-navigation-architecture-component-configuration

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!