@havesource/cordova-plugin-push: File google-services.json is missing

Hi,

I get the following build-error:

UserError: FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ‘:app:processDebugGoogleServices’. > File google-services.json is missing. The Google Services Plugin cannot function without it. See log for full details.

my config.xml contains

    <preference name="AndroidXEnabled" value="true" />
    <plugin name="cordova-plugin-androidx-adapter" />
    <gap:plugin name="@havesource/cordova-plugin-push" spec="2.0.0" >
        <param name="SENDER_ID" value="123123123" />
    </gap:plugin>
    <resource-file src="google-services.json" target="app/google-services.json" />

And my .zip contains the google-services.json in the root and the www folder. My Volt Builder account is developer-at-mobilino.de

I have read all the other support threads containing this problem, but can’t figure out what I am doing wrong. Do you have any idea?

I see you’ve had successful runs since the topic was opened. Did you manage solve this problem?

Thank you for looking into this! No, I have not. I tested if the build is successful when I remove the push-plugin. And yes, without the plugin the build is successful. However, I can not make it work with the plugin. :-/

Is the ID set properly in your google-services.json file?

See this on StackOverflow.

Yes, the IDs are the same:
config.xml:

<widget xmlns = "http://www.w3.org/ns/widgets"
    xmlns:gap = "http://phonegap.com/ns/1.0"
    xmlns:android="http://schemas.android.com/apk/res/android" 
    id = "de.mobilino.virusesInWar2"
    version = "1.10">

google-services.json:
"package_name": "de.mobilino.virusesInWar2"

To be sure, I downloaded the google-services.json from firebase again, but it is still exactly the same.

Thank you nevertheless for looking into this. Do you have any other idea?

I think I found it. You need to specify the resource-file is for the Android platform:

  <platform name="android">
    <resource-file src="google-services.json" target="app/google-services.json"/>
  </platform> 

Give a try!

Wow, you did it!!

This is amazing - I don’t understand why it works (since I thought that for android builds <platform name="android"> tags are ignored). Looks like I just learned something :slight_smile:

Thanks!