@havesource/cordova-plugin-push problems

We have purchased a pro license with account name gcubeteam@gc-solutions.net

We are facing issue in building our app. Please help on this. We are using phonegap push plugin. Have attached zip file of app for your reference.

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.

If I set the target file path as: app/google-services.json in config.xml file then it throws below error:

UserError: FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ‘:app:compileDebugJavaWithJavac’. > Compilation failed; see the compiler error output for details. See log for full details.

The message is correct. Here’s the important part: “File google-services.json is missing.”

There is a google-services.json file in your project. It’s at the top level, a good place for it. However, your config.xml file says this:

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

which is a completely different location. Correct that, and the problem should go away.

Hi,

I tried correcting path multiple times.

i have mentioned the path as:

<resource-file src="google-services.json" target="google-services.json" />

It gives me below error with above path when www, config.xml and google-services files are at the root.

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.

Please provide a solution at the earliest. We have purchased pro license for one month trail and our org will not approve it if we are not able to build it successfully for android.

Have shared a zip of structure and files with you if you can try it once at your end.

Regards,
Anup

How did you share the zip file?

Hi - Thanks for attending this.

Zip link is

Looking at this some more, I see a number of issues with @havesource/cordova-plugin-push which are unrelated to VoltBuilder itself.

  • You’re using Version 1.0.0. The current version, according to npmjs, is 2.0.0. According to GitHub, it’s 3.0.0.

  • The version you need to use depends on the version of cordova-android, VoltBuilder defaults currently to cordova-android@9.0.0, but will be changing soon to cordova-android@10.1.1.

It would be great if someone who is using this plugin could help with what the correct settings are.

Hi VB Team,

Thanks for a quick response but in the error log it says that google-services.json is missing.
I will manage the version issues if you provide help eliminating this error. Detailed logs in VB indicates that it is trying to search inside any other folder. I request if you can check it once using attached zip file code. Many thanks.

Regards,
Anup

it works like this for me
with the file, google-services.json, at the root of the project

<engine name="android" spec="10.1.1"/>

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

<plugin name="@havesource/cordova-plugin-push" spec="2.0.0">
    <variable name="SENDER_ID" value="XXXXXXXX"/>
</plugin>

Tip : If you’re pasting code, html or config files, surround the code with triple back ticks (```), before the first line and after the last one. It will be formatted properly. (We fixed it for you this time)