Search code examples
javascriptcordovapush-notificationphonegapgoogle-play-services

Using PhoneGap Build, it says 'google-services.json is missing' but it's not


I'm building an app for Android, iOS and Windows Phone using Phonegap Build. To send notifications, I'm using the phonegap-plugin-push but can't manage to build the apk.


In my config.xml, I put this to add google-services.json

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

I get this error from PhoneGap Build even though google-services.json is in my root folder beside config.xml

Execution failed for task ':processDebugGoogleServices'.

File google-services.json is missing. The Google Services Plugin cannot function without it.
Searched Location:
/project/src/debug/google-services.json
/project/google-services.json

I still don't get why it's not working while it should as it's exactly what's asked to do. Thanks in advance for any help.


Additional infos :

I'm using phonegap cli-7.1.0 and other cordova plugins beside the push-plugin (2.0.0), here is the list :

<plugin name="cordova-plugin-device" spec="1.1.6" source="npm" />
<plugin name="cordova-plugin-splashscreen" spec="4.0.3" source="npm" />
<plugin name="cordova-plugin-network-information" spec="1.3.3" source="npm" />
<plugin name="cordova-plugin-inappbrowser" spec="1.7.1" source="npm" />
<plugin name="cordova-plugin-statusbar" spec="2.2.3" source="npm" />
<plugin name="cordova-plugin-whitelist" spec="1.3.2" source="npm" />
<plugin name="cordova-plugin-screen-orientation" spec="2.0.1" source="npm" />    

EDIT

It seems that it's an issue with the PhoneGap Build (PGB) version I'm using. The version 2.0.0 of the push-plugin should be build using the new PGB builder. https://blog.phonegap.com/phonegap-7-0-1-now-on-build-and-it-includes-some-important-changes-89087fe465f5


Solution

  • As I stated in the EDIT part of my question, it is related to the builder version of PGB.

    After adding to my config.xml<preference name='pgb-builder-version' value='2' />, google-services.json is found (I still get an error but it's not related to this file anymore)