无法同步gradle

时间:2016-03-07 22:22:43

标签: android android-studio gradle build.gradle

当我尝试将recyclerview和cardview依赖项添加到build.gradle时,我收到错误消息。这是我的build.gradle:

apply plugin: 'com.android.application'

android {
compileSdkVersion 23
buildToolsVersion "23.0.2"

defaultConfig {
    applicationId "com.truewebdev.applytheme"
    minSdkVersion 17
    targetSdkVersion 23
    versionCode 1
    versionName "1.0"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.2.0'
compile 'com.android.support.recyclerview-v7:23.2.0'
compile 'com.android.support.cardview-v7:23.2.0'
}

以下是错误消息: error1 如果我尝试安装存储库,我会得到以下内容: error2

这里有什么问题?

1 个答案:

答案 0 :(得分:1)

您是否从SDK Manager下载了Android支持存储库?

来自android docs:

  

确保您已使用SDK Manager下载了Android支持存储库。

http://developer.android.com/tools/support-library/setup.html#libs-with-res