NavigationView not found in android studio 3.0.1

1

I get this error and I do not know why I was looking and this is the result of my gradle ...

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
implementation 'com.android.support:recyclerview-v7:26.1.0'
implementation 'com.android.support:cardview-v7:26.0.0-beta1'
}

configurations.all {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
    def requested = details.requested
    if (requested.group == 'com.android.support') {
        if (!requested.name.startsWith("multidex")) {
            details.useVersion '25.3.0'
        }
    }
}
}

But even with the last addition, it works for me that was what I found ... Any help ??? Thanks

    
asked by Alex Rivas 27.05.2018 в 22:58
source

1 answer

1

To add a NavigationView to your project you must add the design dependency.

Example:

dependencies {
     ...
     ...
     implementation 'com.android.support:design:26.1.0'
     ...
     ...
     }

Giving Alt + Enter you can add the appropriate dependency to your project for the Design library :

More information:

NavigationView

Android Design support library

After adding it, simply synchronize your build.gradle file with the project.

    
answered by 28.05.2018 / 19:14
source