Adam Varhegyi Adam Varhegyi - 1 month ago 7
JSON Question

File google-services.json is missing from module root folder. The Google Services Plugin cannot function without it

I have a project with 1 module and 2 applications. The module is used for code parts that both applications uses.
Of course i have separate google-services.json files in the app's root folders.

The build was working very well last Friday.

Now i try to compile and got 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 missing in my module root folder.

I dont know what is the problem here?

The module is not an application, why would i have to add a google-services.json file and why it was worked some days ago without modification?

E D I T:

I have made a new google app in google api console and added a new google-services.json file even to my module, got the same error.

Answer

Add multiDexEnabled true in your project app gradle file and check,

defaultConfig {
    multiDexEnabled true
}