【问题标题】:Google Play Service version conflict for Firebase 11.0.2 librariesFirebase 11.0.2 库的 Google Play 服务版本冲突
【发布时间】:2017-07-03 09:13:46
【问题描述】:

我将 Firebase 库更新到了最新版本,但我无法同步 gradle 并导致以下错误:

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

请通过更新 google-services 插件的版本来修复版本冲突(有关最新版本的信息是 可在 https://bintray.com/android/android-tools/com.google.gms.google-services/) 或将 com.google.android.gms 的版本更新为 11.0.2。

正如它所说,我也将 gms 版本更新为 11.0.2。这是我的毕业典礼:

compileSdkVersion 25
buildToolsVersion "26.0.0"

//other gradle config

String googleSupportVersion = '25.3.1'
String googlePlayServicesVersion = '11.0.2'

compile "com.google.firebase:firebase-core:$googlePlayServicesVersion"
compile "com.google.firebase:firebase-auth:$googlePlayServicesVersion"
compile "com.android.support:appcompat-v7:$googleSupportVersion"
compile "com.android.support:support-v4:$googleSupportVersion"
compile "com.google.android.gms:play-services:$googlePlayServicesVersion"
compile "com.android.support:design:$googleSupportVersion"
compile 'com.android.support.constraint:constraint-layout:1.0.2'
}
apply plugin: 'com.google.gms.google-services'

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

我该如何解决这个问题?

【问题讨论】:

标签: android firebase gradle google-play-services


【解决方案1】:

将您的 google 服务插件更新到 3.1.0

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.3.3'
        // 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'
    }
}

【讨论】:

    【解决方案2】:

    试试这个def googlePlayServicesVersion = '11.0.2' 而不是String googlePlayServicesVersion = '11.0.2'

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-04-17
      • 1970-01-01
      • 1970-01-01
      • 2016-03-22
      • 1970-01-01
      • 1970-01-01
      • 2019-02-14
      • 1970-01-01
      相关资源
      最近更新 更多