android - 错误 "please fix the version conflict either by updating the version of the google services plugin' 'a

标签 android gradle build.gradle gradle-plugin

错误:任务“:app:processDebugGoogleServices”执行失败。
请通过更新 google-services 插件的版本(有关最新版本的信息可在 https://bintray.com/android/android-tools/com.google.gms.google-services/ 获得)或将 com.google.android.gms 的版本更新到 10.2.6 来修复版本冲突。


根据我的 build.gradle 版本还可以

build.gradle(模块:应用程序)

apply plugin: 'com.android.application'

android {
    compileSdkVersion 25
    buildToolsVersion '25.0.1'
    defaultConfig {
        applicationId "com.example.deepdepindersingh.mutual"
        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'
        }
    }


    buildTypes.each {
        it.buildConfigField 'String', 'UNIQUE_FIREBASE_ROOT_URL', UniqueFirebaseRootUrl
    }


    packagingOptions {
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/LICENSE-FIREBASE.txt'
        exclude 'META-INF/NOTICE'
    }

}

configurations.all {
    resolutionStrategy {
        force 'com.google.code.findbugs:jsr305:1.3.9'
    }
}
configurations {
    compile.exclude group: "org.apache.httpcomponents", module: "httpclient"
}

dependencies {

    compile 'com.google.firebase:firebase-core:10.2.6'
    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:24.2.1'


    //compile 'com.google.android.gms:play-services:10.2.6'
    compile 'com.firebase:firebase-client-android:2.5.2'
    compile 'com.google.firebase:firebase-auth:9.6.1'
    compile 'com.google.firebase:firebase-core:9.6.1'
    compile 'com.firebaseui:firebase-ui:0.5.3'
    //compile 'com.google.android.gms:play-services-maps:10.2.6'
    compile 'com.android.support:appcompat-v7:25.3.1'
    compile 'com.android.support:design:25.3.1'
    compile 'com.android.support:support-v4:25.3.1'
    compile 'com.android.support:cardview-v7:25.3.1'

    /* For Google Play Services */
    //compile 'com.google.gms:google-services:3.1.0'
    //compile 'com.google.android.gms:play-services-safetynet:10.2.6'
   // compile 'com.google.android.gms:play-services-auth:10.2.6'
    testCompile 'junit:junit:4.12'

}

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

build.gradle(项目)
// 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.2'
        classpath 'com.google.gms:google-services:3.1.0'

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

allprojects {
    repositories {
        jcenter()
    }
}

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

最佳答案

您在依赖项中使用 10.2.6 for firebase
编译'com.google.firebase:firebase-core:10.2.6'

其余为 9.6.1
编译'com.google.firebase:firebase-auth:9.6.1'
编译'com.google.firebase:firebase-core:9.6.1'

对于谷歌相关的东西,您必须始终使用相同的版本。
将 firebase auth 和 core 也更改为 10.2.6

关于android - 错误 "please fix the version conflict either by updating the version of the google services plugin' 'a,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44390176/

相关文章:

android - 检测开放的 WiFi 网络

android - 大胆的 ClickableSpan 触摸

android - Websocket 连接不再适用于 Cordova Android 7

android - 更改 native 应用程序中的包名称

Android构建错误: org. gradle.api.tasks.TaskExecutionException

python - Android 应用程序与 Python 后端之间的通信

Android studio3.3 variantOutput.getProcessResources() 已过时,已替换为 'variantOutput.getProcessResourcesProvider()

gradle - 如何使用 gradle 构建测试依赖图

intellij-idea - 使用Gradle时如何使IDEA/Android Studio识别我的单元测试文件夹?

Gradle 永远不会在 JCenter 存储库之前解析 Artifactory 的依赖项