【发布时间】: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