无法解决:com.android.support.design:21.0.3

时间:2018-02-21 06:20:07

标签: android

我在build.gradle(Module:app)添加了以下行:

compile 'com.android.support:design:21.0.3' 

但在执行 Gradle 时,我正在

  

无法解决:com.android.support.design:21.0.3

我从android支持设计库中获取了该代码并将其添加到新项目中。我把它添加到依赖部分:



apply plugin: 'com.android.application'

android {
    compileSdkVersion 26
    buildToolsVersion "26.0.2"
    defaultConfig {
        applicationId 'com.solodroid.androidnewsapp'
        minSdkVersion 17
        targetSdkVersion 26
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    productFlavors {
    }
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    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:21.0.3'
    compile 'com.android.support:design:21.0.3'

    compile 'com.google.android.gms:play-services:6.5.87'
    compile 'com.android.support:recyclerview-v7:21.+'
    compile files('libs/StartAppInAppPlus-2.3.jar')


}




2 个答案:

答案 0 :(得分:0)

使用相同版本的appcompat作为sdk版本。另外在较新的android studio中使用implementation keyword。

hist.x_labels = [x for x in list(range(2,max_result+1))]

<强> IMP

或者首先检查您的sdk是否已下载版本21.0.3。

答案 1 :(得分:0)

您应该在app gradle中添加官方google存储库。如果其他模块需要该存储库,也可以在项目gradle上。

apply plugin: 'com.android.application'

buildscript {
    repositories {
        google()
    }
}

...

android {
...