Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

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

like image 762
Yousuf Sohail Avatar asked May 10 '18 10:05

Yousuf Sohail


People also ask

What is the resource type of Navigation graph?

When you add your first navigation graph, Android Studio creates a navigation resource directory within the res directory. This directory contains your navigation graph resource file ( nav_graph. xml , for example).

What is Androidx Navigation?

Navigation is a framework for navigating between 'destinations' within an Android application that provides a consistent API whether destinations are implemented as Fragments, Activities, or other components. Latest Update. Stable Release. Release Candidate. Beta Release.


2 Answers

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

like image 141
Bartosz Musiał Avatar answered Sep 22 '22 07:09

Bartosz Musiał


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

like image 38
Yousuf Sohail Avatar answered Sep 20 '22 07:09

Yousuf Sohail