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'.
Asked
Active
Viewed 2.5k times
12

bcsb1001
- 2,834
- 3
- 24
- 35

Dushyant Suthar
- 673
- 2
- 9
- 27
4 Answers
16
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.

Mrdrew
- 191
- 5
-
2Brilliant! Now it is `compile 'com.android.support:design:23.2.1'` with a very recent version. – Neurotransmitter Apr 05 '16 at 20:00
-
Where do you enter this in Visual Studio (Xamarin Android)? – JotaPardo Jul 27 '17 at 23:27
4
before importing support library, Make sure you have downloaded Android Support Repository using SDK Manager.

Milad Nouri
- 1,587
- 1
- 21
- 32
-
2In my version of Android Studio 2.1.2+ you get the problems described in 0:Messages window with hyper-link. Clicking on it should bring you to automated download and install dialog. Just confirm and let the IDE install missing packages for you :) – Sold Out Sep 22 '16 at 09:49
2
If you have this error with compile design:22 or higher just restart your Android Studio.

Александр Тихонович
- 199
- 1
- 3
-
Migrated my code to my new computer. After the initial gradle build the imports from the design library. After a restart of Android studio everything was as inteded. – RoadXY Feb 11 '18 at 19:34
0
If in your app build.gradle
file compileSdkVersion
reads as say 28
,
then add the following line under dependencies:
dependencies {
--other dependencies
implementation 'com.android.support:design:28.0.0'
}
Change the version number according to your compiledSdkVersion
Then re-build your project. This brings in the required dependency.

bhaskarc
- 9,269
- 10
- 65
- 86