Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ERROR: File google-services.json is missing. (Since com.google.gms:google-services updated from 4.2.0 to 4.3.0)

Since I updated com.google.gms:google-services from version 4.2.0 to 4.3.0 in my top level build.gradle, I cannot compile my project any more because I have the error :

"File google-services.json is missing"

My google-services.json are in :

  • /My/personnal/project/app/src/ProductFlavors/BuildTypes

(for example)

  • /My/personnal/project/app/src/AT/debug

  • /My/personnal/project/app/src/DE/debug

  • /My/personnal/project/app/src/AT/release (...)

When my version is 4.2.0, I have no issue but in 4.3.0 I have the error and the Searched Location is: /My/personnal/project/app/google-services.json

not working

dependencies {
        classpath 'com.android.tools.build:gradle:3.4.2'
        classpath 'com.google.gms:google-services:4.3.0'
    }

working

dependencies {
        classpath 'com.android.tools.build:gradle:3.4.2'
        classpath 'com.google.gms:google-services:4.2.0'
    }

EDIT 1

Looks like it has been resolved with version 4.3.1

EDIT 2

Looks like issue is back on version 4.3.2 :(

EDIT 3

Issue still there with 4.3.3 :(

like image 224
Romain Barbier Avatar asked Jul 22 '19 14:07

Romain Barbier


People also ask

Where is Google-services JSON file?

The google-services. json file is generally placed in the app/ directory (at the root of the Android Studio app module).

Where is the JSON file for Google services plugin?

File google-services.json is missing. The Google Services Plugin cannot function without it. Searched Location: C:\Users\vikas\AndroidStudioProjects\FireBaseFunctionality\app\src\debug\google-services.json C:\Users\vikas\AndroidStudioProjects\FireBaseFunctionality\app\google-services.json are you sure you've copied it to the root of your project?

Why can't I add Google services to my Firebase product?

That Problem is because:- The folder or file you pasted to your product downloaded from the firebase console is not named as google-services.json. so now click it then right mouse click in all the options open refractor and rename it to google-services.json. because this worked for me Had faced same issue ..

How to refactor a Google services project?

Just refactoring the file to google-services.json from google_services.json works like charm.. Hope this helps!!! P.S. I know it's sound silly but this only works for me... Navigate to your project folder and open the /app sub-folder. Paste the .json file here. Rebuild the project.

Is it possible to recreate the XML file of Google-services?

If your Android project has some configuration that prevents you from using the google-services plugin, you can safely recreate the XML files manually using these values: Q: When building I get the following error message: "File google-services.json is missing from module root folder.


1 Answers

There is already an open issue on github based on this

https://github.com/google/play-services-plugins/issues/91

The problem is google-services plugin ignores the build variant if it starts with a capital letter.

If you refactor the build variant names to camelCase, then it seems to detect the google-services.json file.

like image 174
Subin S V Avatar answered Oct 19 '22 03:10

Subin S V