所以今天早上我开始更新到我的项目库的最新版本。
我正在尝试将 GCM 更新到最新版本 9.2.0,但出现此错误:
错误:任务“:app:processDebugGoogleServices”执行失败。请通过更新 google-services 插件的版本来修复版本冲突(有关最新版本的信息可在 https://bintray.com/android/android-tools/com.google.gms.google-services/ 获得)或将 com.google.android.gms 的版本更新为 9.0.0。
这就是我的代码:
dependencies {
classpath 'com.android.tools.build:gradle:2.1.2'
classpath 'com.google.gms:google-services:3.0.0'
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
}
接着:
dependencies {
...
compile "com.google.android.gms:play-services-gcm:9.2.0"
...
}
任何人有同样的问题/解决了同样的问题?
谢谢。
编辑
显然,您必须在 app/build.gradle 文件的底部应用您的 GSM 插件。否则,版本 9.2.0 将导致您的项目发生冲突。
作为参考,这就是我的 app/build.gradle 文件现在的样子:
apply plugin: "com.android.application"
apply plugin: "com.neenbedankt.android-apt"
android {
...
}
dependencies {
...
// Google Cloud Messaging
compile "com.google.android.gms:play-services-gcm:9.2.0"
...
}
apply plugin: "com.google.gms.google-services"
原文由 herrmartell 发布,翻译遵循 CC BY-SA 4.0 许可协议
你有线吗
应用程序的 build.gradle 文件底部的行?
当它在顶部时我看到了一些错误,因为它写 在这里,它应该在底部。