Navigation Architecture Component - New Resource dialog doesn't have Navigation resource type for navigation graph
W

5

22

New Resource dialog doesn't have Navigation resource type for navigation graph even after adding Navigation Architecture Component dependencies

def nav_version = '1.0.0-alpha01'
implementation "android.arch.navigation:navigation-fragment:$nav_version"
implementation "android.arch.navigation:navigation-ui:$nav_version"

enter image description here

Wilcher answered 10/5, 2018 at 10:39 Comment(0)
B
60

Make sure that you checked the box Settings -> Experimental -> Enable Navigation Editor.

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

Help -> What's New in Android (Android Studio 3.2 Beta 1)

after that , restart Android Studio

Bygone answered 22/6, 2018 at 8:57 Comment(2)
After updating "Android Studio 3.2 Beta 1", the Design tab is not showing. Your answer saved my time. Answer is available here : https://mcmap.net/q/586929/-android-studio-3-2-beta-navigation-architecture-component-configurationSherlocke
I also had to restart Android StudioLindstrom
W
7

It works in Android Studio 3.2 which is in Canary at the time of writing.

Android Studio 3.2 features tools for Android Jetpack including a visual Navigation Editor and new code refactoring tools.

https://android-developers.googleblog.com/2018/05/google-io-2018-whats-new-in-android.html

Wilcher answered 10/5, 2018 at 15:16 Comment(0)
H
5

I don't know why it's not showing up for me either but there is a workaround.

Right click on res --> select Android Resource Directory --> select Resource type as navigation click ok --> select the newly created navigation directory --> right click File and put in the name nav_graph.xml --> once the file opens paste this code:

<?xml version="1.0" encoding="utf-8"?>
<navigation xmlns:android="http://schemas.android.com/apk/res/android">
</navigation>
Hereditable answered 10/5, 2018 at 13:54 Comment(3)
Navigation tag is not recognisable.Wilcher
@YousufSohail did you create the file in the navigation folder?Hereditable
It appears that Android Studio 3.2 beta 1 has this problem as well.Ia
D
1

I was using Android Studio 3.2.1 but it would not load the navigation editor. Complained about not being able to install the navigation fragment dependency. Only after I invalidated Android Studio's cache and restarted did it work.

Documentary answered 20/11, 2018 at 18:31 Comment(0)
Z
0

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.

Zlatoust answered 8/10, 2018 at 6:57 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.