Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Failed to resolve: com.android.support:cardview-v7:26.0.0 android

i try to add recyclerview to my project and get this error appear and i added it from android studio dependencies this is error appear when try to add recyclerview in android studio

this is the compiled version ...

like image 662
ahmed khattab Avatar asked Jul 14 '17 12:07

ahmed khattab


2 Answers

Starting from version 26 of support libraries make sure that the repositories section includes a maven section with the "https://maven.google.com" endpoint.

Something like;

allprojects {
    repositories {
        jcenter()
        maven {
            url "https://maven.google.com"
        }
    }
}
like image 182
Gabriele Mariotti Avatar answered Oct 18 '22 15:10

Gabriele Mariotti


This is how I have it working.

  1. Add maven { url "https://maven.google.com" } as @Gabriele_Mariotti suggests above.

    allprojects {
        repositories {
            jcenter()
            maven {
                url "https://maven.google.com"
            }
        }
    }
    
  2. Then on the build.gradle file inside the App folder add

    compileSdkVersion 26
    buildToolsVersion "25.0.3"
    defaultConfig {
        applicationId "com.xxx.yyy"
        minSdkVersion 16
        targetSdkVersion 26
    }
    
  3. Then on the dependencies use

    dependencies {
        compile 'com.android.support:appcompat-v7:26.0.1'
        compile 'com.android.support:design:26.0.1'
        compile 'com.google.android.gms:play-services-maps:11.0.4'
        compile 'com.google.android.gms:play-services-location:11.0.4'
        compile 'com.mcxiaoke.volley:library-aar:1.0.0'
        compile 'com.android.support:cardview-v7:26.0.1'
    }
    
like image 26
macbee Avatar answered Oct 18 '22 15:10

macbee