相关疑难解决方法(0)

Google Play服务GCM 9.2.0要求"更新"回9.0.0

所以今天早上我开始更新到我的项目库的最新版本.

我正在尝试将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'
}
Run Code Online (Sandbox Code Playgroud)

然后:

dependencies {
    ...

    compile "com.google.android.gms:play-services-gcm:9.2.0"

    ...
}
Run Code Online (Sandbox Code Playgroud)

任何人有同样的问题/修复同样的问题?

谢谢.

编辑

显然你必须在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"
Run Code Online (Sandbox Code Playgroud)

android google-cloud-messaging google-play-services

178
推荐指数
5
解决办法
12万
查看次数