1. 程式人生 > >接入google+登入SDK提示google-services.json is missing

接入google+登入SDK提示google-services.json is missing

接入google+登入SDK時下載官方的demo,然後一堆問題,於是把該安裝的最新的庫都安裝了。
但仍然有如下錯誤。

Information:Gradle tasks [:app:generateDebugSources, :app:mockableAndroidJar, :app:prepareDebugUnitTestDependencies, :app:generateDebugAndroidTestSources]
Warning:WARNING: Dependency org.apache.httpcomponents:httpclient:4.0.1 is ignored for
debug as it may be conflicting with the internal version provided by Android. Warning:WARNING: Dependency org.apache.httpcomponents:httpclient:4.0.1 is ignored for release as it may be conflicting with the internal version provided by Android. Error:Execution failed for task ':app:processDebugGoogleServices'. > File google-services.json is
missing. The Google Services Plugin cannot function without it. Searched Location: C:\Users\Administrator\Downloads\google-services-master\android\signin\app\src\debug\google-services.json C:\Users\Administrator\Downloads\google-services-master\android\signin\app\google-services.json Information:BUILD FAILED Information:Total time
: 1.244 secs Information:1 error Information:2 warnings Information:See complete output in console

也就是說找不到這個檔案 File google-services.json is missing。
這種問題可不好解決,鬼知道這個google-services.json是個什麼鬼。

在Stack Overflow搜到一哥們的一句話。
You should delete a line apply plugin: ‘com.google.gms.google-services’
because “com.android.application” package already has same package.

看了一下build.gradle檔案確實有如下兩句:

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

也就是說com.android.application已經包含com.google.gms.google-services這個包了。因為重複引入所以找不到吧。(MD為什麼不提示重複而提示找不到?)