【问题标题】:Gradle: Error version conflictGradle:错误版本冲突
【发布时间】:2016-12-26 07:54:49
【问题描述】:

我遇到了这样的错误:

错误:任务 ':app:processDebugGoogleServices' 执行失败。

请通过更新版本来修复版本冲突 google-services 插件或将 com.google.android.gms 的版本更新到 9.0.0。

如何更新 google-service 插件或更新 com.google.android.gms 的版本?或者我应该在 build.gradle 中改变什么?

我的应用程序/build.gradle:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 24
    buildToolsVersion "24.0.1"

    defaultConfig {
        applicationId "com.example.test"
        minSdkVersion 15
        targetSdkVersion 24
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    packagingOptions{
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/LICENSE-FIREBASE.txt'
        exclude 'META-INF/NOTICE'

    }
}

dependencies {
    compile 'com.android.support:appcompat-v7:23.1.1'

    // Firebase Authentication
    compile 'com.google.firebase:firebase-auth:9.4.0'

    // Google Sign In SDK (only required for Google Sign In)
    compile 'com.google.android.gms:play-services-auth:9.4.0'

    androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.2'
    androidTestCompile 'com.android.support.test:runner:0.5'
}

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

根build.grade的代码:

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.0.0'
        classpath 'com.google.gms:google-services:3.0.0'

    }
}

allprojects {
    repositories {
        jcenter()
    }
}

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

【问题讨论】:

  • 在您的 Gradle 中将此 apply plugin: 'com.google.ms.google-services' 更改为 apply plugin: 'com.google.gms.google-services'。

标签: java android gradle


【解决方案1】:

您的脚本中有错字:

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

应该是

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-11-03
    • 1970-01-01
    • 1970-01-01
    • 2018-09-16
    相关资源
    最近更新 更多