4

我正在使用這些庫將Firebase與我現有的項目集成在一起谷歌服務插件無法檢測到com.google.android.gms或com.google.firebase的任何版本,默認版本:9.0.0將被使用

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來修復版本衝突。

無法弄清楚發生了什麼?

這些都是我的播放服務verison enter image description here

+0

在該文件中你已經添加的依賴-classpath?它應該位於根文件夾中的「build.gradle」中。 另外看看gardle版本。我用過2.13。 –

+0

依賴關係類路徑是在適當的文件,因爲我運行這個項目,因爲過去8個月。每當我們決定移動firebase並更改palysevices版本,這些問題開始出現 –

+0

您是否在gradle.build中添加了「apply插件:'com.google.gms.google-services'」?我已經使用這個[教程](http://shubhank101.github.io/iOSAndroidChaosOverFlow/2016/06/Implementing-FCM-(-Firebase-Cloud-Messaging-)-in-Android-App) –

回答

7

我在的build.gradle加入這一行最後:(模塊:APP)

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

,並開始工作,我不知道是什麼這是背後的概念嗎?
但它正在努力

+2

Ty。我把它從GCM遷移到頂端,並且爲了不起作用而敲了我的腦袋2個小時 –

相關問題