Search code examples
push-notificationphonegap-pluginsphonegap-buildphonegap-pushplugin

File google-services.json is missing. where to find this file ? PHONEGAP


NOTE !!


before declare it as duplicate :

i have found so many similar questions on stackoverflow , but the majority of askers seems to know where to find the file , i don't . they mention gradle and such things which i know nothing about !


My question


i am working on a phonegap project . i don't have any experience in android development .

after installing push plugin on my project and trying to build the project using phonegap build android . i get this error :

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

even the documentation of the plugin say that i have to get a google-services.json file and put it in my phonegap project folder .

As of version 2.0.0 the SENDER_ID parameter has been removed at install time. Instead you put your google-services.json (Android) and/or GoogleService-Info.plist in the root folder of your project and then add the following lines into your config.xml.

the main problem is that i have no idea where to find the google-services.json and how can i get it updated with a SENDER_ID and other google API variables .

Extra info:

i am using phonegap on linux mint , i have an installed android studio .


Solution

  • You can get the google-services.json from firebase developer console.

    Click your application, here the application name is testapp

    enter image description here

    Next you will find this screen click on the menu you will see settings click on it.

    screen 2

    In setting you will be able to see the "Download Google-services.json" button.

    screen 3

    There you will find the google-services.json file for your existing project.

    Hope this helps.