15

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!

creativecreatorormaybenot
  • 114,516
  • 58
  • 291
  • 402

3 Answers3

29

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'
creativecreatorormaybenot
  • 114,516
  • 58
  • 291
  • 402
Abhishek Aryan
  • 19,936
  • 8
  • 46
  • 65
1

You are using Google signin right? So u definitely need a google-services.json file

Refer this link

https://developers.google.com/identity/sign-in/android/start-integrating

Add the dependency to your project-level build.gradle:

classpath 'com.google.gms:google-services:3.0.0'

Add the plugin to your app-level build.gradle:

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

karthik
  • 91
  • 6
1

The gradle-plugin google-services that is referenced by classpath and with apply is a build-time plugin only! So it only influences the build-process of your app, but not the runtime-process! Thats why your app is working fine but google-services json is required.

kj007
  • 6,073
  • 4
  • 29
  • 47