0

Previously Asked Question

I cannot install the cardview support repository. Gradle recognizes that I need it installed and gives the following error. I cannot however click the install repository and sync. Rather, I can click it but nothing happens when I do.

Picture of error My App Gradle File

    apply plugin: 'com.android.application'

android {
    compileSdkVersion 25
    buildToolsVersion "25.0.0"
    defaultConfig {
        applicationId "pro.bladebeat.projectpsittacosaurus"
        minSdkVersion 19
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile 'com.android.support:appcompat-v7:25.3.1'
    compile 'com.android.support:cardview-v7.25.0.0'
    compile 'com.android.support:recyclerview-v7:25.3.1'
    compile 'com.android.support.constraint:constraint-layout:1.0.1'
    compile 'com.android.support:design:25.3.1'

testCompile 'junit:junit:4.12' }

And my Project Gradle File

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.3.3'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
        maven {
            url "https://maven.google.com"
        }
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}
OneCricketeer
  • 179,855
  • 19
  • 132
  • 245
miversen33
  • 573
  • 5
  • 19

2 Answers2

1

Use compile 'com.android.support:cardview-v7:25.3.1' instead of compile 'com.android.support:cardview-v7.25.0.0'

This will fix the typo, as well as match the version of the support libraries you are using (as pointed out by cricket_007).

Ajil O.
  • 6,562
  • 5
  • 40
  • 72
0

Go to Your Android SDK Manager and then install/update the "Android Support Repository" in your SDK Manager. It will then find the dependency.

Rohn
  • 95
  • 2
  • 13