【问题标题】:Gradle sync error when adding Material Spinner dependency添加 Material Spinner 依赖项时出现 Gradle 同步错误
【发布时间】:2017-09-22 07:17:18
【问题描述】:

当尝试为 Material Spinner 的最新版本 (2.0.0) 添加依赖项时,我的 gradle 同步失败并出现错误:

Error:(33, 14) Failed to resolve: com.github.ganfra:material-spinner:2.0.0

这是我的 build.grade

apply plugin: 'com.android.application'

android {
compileSdkVersion 23
buildToolsVersion "26.0.1"
defaultConfig {
    applicationId "com.myroommate.myroommate"
    minSdkVersion 23
    targetSdkVersion 23
    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:23.4.0'
compile 'com.android.support:support-v4:23.4.0'
compile 'com.android.support:design:23.4.0'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
testCompile 'junit:junit:4.12'
compile 'com.android.support:cardview-v7:25.3.1'
compile 'com.android.volley:volley:1.0.0'
compile ('com.github.ganfra:material-spinner:2.0.0') {
    exclude group: 'com.android.support', module: 'appcompat-v7'
}
}

但是当我更改Material Spinner version to 1.1.1 时,gradle 同步正在完成,没有任何错误。

compile ('com.github.ganfra:material-spinner:1.1.1') {
    exclude group: 'com.android.support', module: 'appcompat-v7'
}

即使使用 1.1.2 也会使我的 gradle 构建失败。我想使用最新版本的 Material Spinner,我在这里做错了什么?

【问题讨论】:

    标签: android github gradle build android-spinner


    【解决方案1】:

    该版本尚未推送到 maven。 很快就会好的。 检查this

    【讨论】:

    • 谢谢。没想到 1.1.2 和 2.0.0 是两天前发布的。我会等