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

时间:2016-06-13 12:07:44

标签: android android-gradle google-play-services 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'

依赖

    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
}

我收到此错误

Error:Execution failed for task ':app:processDebugGoogleServices'.
  

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

无法弄清楚发生了什么?

这些是我的游戏服务版  enter image description here

2 个答案:

答案 0 :(得分:7)

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

 apply plugin: 'com.google.gms.google-services'

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

答案 1 :(得分:0)

您可以通过gradle文件覆盖默认选择,这样做可以避免RA项目与客户端之间发生冲突:Duplicate entry: com/google/firebase/FirebaseApiNotAvailableException.class