google-services插件无法检测到com.google.android.gms或com.google.firebase的任何版本,将使用默认版本:9.0.0

Lok*_*ari 6 android google-play-services android-gradle-plugin gradle-plugin

我正在将fire-base集成到我使用这些库的现有项目中

   compile 'com.google.firebase:firebase-auth:9.0.2'
compile 'com.google.firebase:firebase-database:9.0.2'
compile 'com.google.android.gms:play-services:9.0.2'
Run Code Online (Sandbox Code Playgroud)

依赖

    dependencies {
    classpath 'com.android.tools.build:gradle:2.1.2'
    classpath 'com.google.gms:google-services:3.0.0'
    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}
Run Code Online (Sandbox Code Playgroud)

我收到了这个错误

Error:Execution failed for task ':app:processDebugGoogleServices'.
Run Code Online (Sandbox Code Playgroud)

请通过更新google-services插件的版本来修复版本冲突(有关最新版本的信息,访问https://bintray.com/android/android-tools/com.google.gms.google-services/)或将com.google.android.gms的版本更新为9.0.0.

无法弄清楚发生了什么?

这些是我的游戏服务版 在此输入图像描述

Lok*_*ari 7

我最后在build.gradle中添加了这一行:(Module:app)

 apply plugin: 'com.google.gms.google-services'
Run Code Online (Sandbox Code Playgroud)

它开始工作我不知道这背后的概念是什么?
但它正在发挥作用

  • TY.我把它从GCM迁移到最顶层并且在2小时内敲打我为什么它不起作用 (3认同)