Gradle错误。混合库必须是相同的版本

时间:2018-02-08 15:45:12

标签: android gradle

希望有人能够帮助我。不知怎的,我无法解决这个问题。长话短说,我总是有这个错误。不知道该怎么办。

The error in cause:

这一切都是在我向项目添加“Glide”时开始的。 这是“Glide”的链接,以防这对某事有所帮助。

https://github.com/bumptech/glide

这是我的Gradle项目:(模块:app)

android {
compileSdkVersion 26
defaultConfig {

    applicationId "******"
    minSdkVersion 19
    targetSdkVersion 26
    versionCode 1
    versionName "1.0"
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

    dataBinding {
        enabled = true
    }


}
buildTypes {
    release {

        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}

}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.github.bumptech.glide:glide:4.6.1'
annotationProcessor 'com.github.bumptech.glide:compiler:4.6.1'
implementation 'com.android.support:appcompat-v7:26.0.0'
implementation 'com.android.support:support-compat:26.0.0'
implementation 'com.android.support:animated-vector-drawable:26.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.google.firebase:firebase-auth:11.0.4'
implementation 'com.google.firebase:firebase-storage:11.0.4'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'

} apply plugin: 'com.google.gms.google-services'

这是我的gradle项目:

buildscript {

repositories {
    google()
    jcenter()


}
dependencies {
    classpath 'com.android.tools.build:gradle:3.0.1'



    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
    classpath 'com.google.gms:google-services:3.1.0'
}

}

allprojects {
repositories {
    google()
    jcenter()
    mavenCentral()

}

}

task clean(type: Delete) {
delete rootProject.buildDir

}

提前致谢!

1 个答案:

答案 0 :(得分:2)

您使用的滑动版本取决于支持库的版本27.0.2。

您可以使用较旧版本的滑动,或将项目中的支持​​库更新为27.0.2。

或者,您可以将解析策略添加到主build.gradle。如果滑行使用仅在27.0.2中可用的方法,这可能会导致滑行问题。

allprojects {
  configurations.all {
    resolutionStrategy {
        force 'com.android.support:support-compat:27.0.2'
    }
}