【发布时间】:2016-11-02 18:46:18
【问题描述】:
所以今天早上我开始更新到我的项目库的最新版本。
我正在尝试将 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"
【问题讨论】:
-
同样的问题,我回滚到 9.0.0
-
@mbonnin 我最终也做了同样的事情。但肯定想知道这里发生了什么。还没有幸运地找到答案。
-
然后 9.0.0 有这个错误 stackoverflow.com/questions/37361651/… 并且解决方案似乎是更新到 9.2.0...。由于这里的错误,这是不可能的:-(
-
如果我像 Gusthema 所说的那样在 build.gradle 文件的末尾应用插件,它就可以工作
-
在我的帖子here 中阅读如何正确解决此问题。
标签: android google-cloud-messaging google-play-services