In an activity, I try to create a side menu. For this I am using the NavigationView object following this tutorial:
User Interface on Android: Navigation Drawer (NavigationView)
The problem I have is that I do not recognize this object, the message that shows me in the Preview is the following:
The following classes could not be found: - android.support.design.widget.NavigationView (Fix Build Path, Create Class)
I've tried adding other libraries but it still gives me an error.
My gradle file is as follows:
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "net.pablo.android.app"
minSdkVersion 15
targetSdkVersion 21
versionCode 20
versionName "1.18"
}
buildTypes {
debug {
debuggable true
}
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
allprojects {
repositories {
maven { url "https://jitpack.io" }
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile('org.simpleframework:simple-xml:2.7.1') {
exclude module: 'stax'
exclude group: 'stax', module: 'stax-api'
exclude group: 'xpp3', module: 'xpp3'
}
compile 'com.android.support:appcompat-v7:21.0.3'
compile 'com.android.support:support-v4:21.0.3'
compile 'com.google.code.gson:gson:2.3.1'
compile 'com.google.android.gms:play-services-maps:9.4.0'
compile 'com.google.android.gms:play-services-location:9.4.0'
compile 'com.androidplot:androidplot-core:0.9.8'
compile 'com.github.PhilJay:MPAndroidChart:v3.0.0-beta1'
compile 'joda-time:joda-time:2.9.4'
compile 'com.google.maps.android:android-maps-utils:0.4+'
}
Following the comment of @ A.Cedano, I tried to put the file gradle the following line:
compile 'com.android.support:design:21.0.3'
but I still get error, the following:
Failed to resolve: com.android.support:design:21.0.3
It gives me the option of Install Repository and sync project but when I press it to install this repository it does not do anything, it does not install anything.