【问题标题】:Google authentication version conflict with Google Maps谷歌认证版本与谷歌地图冲突
【发布时间】:2018-01-12 15:23:41
【问题描述】:

我在关注the official Google authentication process。我的应用已经在使用最新版本的 Google 地图。

项目

dependencies {
    classpath 'com.android.tools.build:gradle:3.0.1'
    classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    classpath 'com.google.gms:google-services:3.1.2'

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

应用程序

apply plugin: 'com.google.gms.google-services'
....
implementation 'com.google.android.gms:play-services-maps:11.8.0'
implementation 'com.google.android.gms:play-services-auth:11.8.0'

地图下方有一条红线,弹出窗口显示它找到了 11.8.0 和 11.4.2。构建错误消息类似于,

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

请通过更新 google-services 插件的版本(有关最新版本的信息可在 https://bintray.com/android/android-tools/com.google.gms.google-services/ 获得)或将 com.google.android.gms 的版本更新到 11.4.2 来解决版本冲突。

如果我注释掉apply plugin: 'com.google.gms.google-services',构建错误就会消失,但是官方文档告诉我要添加它。

我该如何解决这个问题?

【问题讨论】:

  • 您的项目使用多个版本的 Google 库。您可以使用以下命令找到哪个库使用哪个版本 请在 Android 终端上运行以下命令 ./gradlew -q dependencies app:dependencies --configuration compile 它将显示您项目中使用的当前和最新的库。

标签: android google-play-services


【解决方案1】:

在项目级build.gradle的依赖中添加如下一行:

classpath 'com.google.gms:google-services:3.0.0'

有关完整的工作示例,请查看 github 上的 following project

检查':app:processDebugGoogleServices'Android Studio Gradle: Error:Execution failed for task ':app:processDebugGoogleServices'.

希望对您有所帮助。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2013-08-08
    • 2018-03-03
    • 2012-02-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-10-17
    相关资源
    最近更新 更多