Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to import android.support.design.widget.NavigationView

I want to have navigation drawer in my application so I am following a tutorial here, in which he has imported the NavigationView library within his project. When I import that library, an error pops up: 'can not resolve'. So again when I hover over the import statement and select 'find jar on web', a message shows saying 'no such library found'.

like image 453
Dushyant Suthar Avatar asked Sep 11 '15 21:09

Dushyant Suthar


3 Answers

I am also facing the same problem and i found a solution by adding the following code to build.gradle

compile 'com.android.support:design:22.2.0'

I also adjusted my targetSdk in the build.gradle file to 22 and i was able to succesfully import the NavigationView without any problem.

like image 103
Mrdrew Avatar answered Oct 23 '22 09:10

Mrdrew


before importing support library, Make sure you have downloaded Android Support Repository using SDK Manager.

like image 4
Milad Nouri Avatar answered Oct 23 '22 09:10

Milad Nouri


If you have this error with compile design:22 or higher just restart your Android Studio.

like image 2
Александр Тихонович Avatar answered Oct 23 '22 09:10

Александр Тихонович