The file google-services.json is not in the root folder of the module. Google Services Plugin Cannot Work Without It

I have a project with 1 module and 2 applications. The module is used for parts of the code that are used by both applications. Of course, I have separate google-services.json files in the root folders of the application.

Last Friday, the assembly worked very well.

Now I am trying to compile and get this error:

File google-services.json is missing from module root folder. The Google Services Plugin cannot function without it. :DoToDoSenderApp:compileDebugSources :DoToDoSenderApp:transformClassesWithDexForDebug UNEXPECTED TOP-LEVEL EXCEPTION: Error:Execution failed for task ':DoToDoSenderApp:transformClassesWithDexForDebug'. > com.android.build.transform.api.TransformException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.8.0_45\bin\java.exe'' finished with non-zero exit value 2 

The only informative error message was about this google-services.json file, which is not in the root folder of my module.

I do not know what's the problem?

The module is not an application, why should I add the google-services.json file and why did it work a few days ago without changes?

Edit

I made a new Google application in the Google API console and added a new google-services.json file even to my module, got the same error.

+6
json android google-play-services google-cloud-messaging
Oct 26 '15 at 9:27
source share
3 answers

Add the multiDexEnabled file to the gradle project application file and check

 defaultConfig { multiDexEnabled true } 
0
Nov 03 '15 at 10:35
source share

This problem is explained by the fact that: - The folder or file that you inserted into your product downloaded from the firebase console is not called google-services.json. so now click on it, then right-click on all parameters to open the refractor and rename it to google-services.json. because it worked for me

0
Nov 09 '16 at 13:09
source share
  • Go to firebase console

  • Create a new project.

  • Then click “Add Firebase” to the Android app.

  • Add package name (from AndroidManifest.xml)

  • Then it will generate google-services.json

  • Copy this file and add it to (i) the root of the project (ii) your project> application

  • Sync Project (Tools → Android → Gradle File Sync Project)

Hope this helps you :)

0
Jul 18 '17 at 17:20
source share



All Articles