Google Services Plugin cannot function without google-services.json

creativecreatorormaybenot picture creativecreatorormaybenot · Mar 19, 2017 · Viewed 23.2k times · Source

File google-services.json is missing. The Google Services Plugin cannot function

I get this error code since I deleted my google-services.json file from my project. Now the obvious way to solve this issue would be to include it again, but I had a reason to remove it.

"Note: If you enabled only Google Sign-In when you generated the configuration file, you can skip this step. Google Sign-In does not require the configuration file to be included in your project—generating the file performs the neecessary configuration steps." - this is the official note in the documentation and since I only enabled Google Sign-In I don't see a reason for this error message. Does anyone have had this problem too and a solve to it because I think that I implemented everything correctly.

Note: It works with the file in the project included.

EDIT: To clarify, my application works completely fine and I have no problems, but I wondered why I cannot remove the google-services.json file even though I should be able to do it with no problem!

Answer

Abhishek Aryan picture Abhishek Aryan · May 14, 2017

When you add apply plugin: 'com.google.gms.google-services' inside your app-level build.gradle it parses configuration information from the google-services.json file.

You removed google-services.json file, that's why it is not able to parse
So remove the below line too from your app-level build.gradle who triggered parsing to make it work again.

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