File google-services.json is missing


#1

Hi All,

I am using Ionic 2. In order to make use of Googles Push Notification Service, I need to install:

ionic plugin add cordova-plugin-fcm

However, after doing so, I get this error when I try build the app:

Error: cmd: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':processDebugGoogleServices'.
> File google-services.json is missing. The Google Services Plugin cannot function without it.
   Searched Location:
  E:\Development\IDE\ionic-apps\theWhoZoo\platforms\android\src\debug\google-services.json
  E:\Development\IDE\ionic-apps\theWhoZoo\platforms\android\google-services.json

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

So it appears to be missing the dependency google-services.json I think. Do I need to install it? How?

If anyone can assist I would appreciate it.


#2

Solution

I copied google-services.json to \platforms\android.


#3

where did you find google-services.json ?


#4

I just got this (or similar) issue because (I think) I updated phonegap-plugin-push to 2.0.0-rc3

Go to your project on https://console.firebase.google.com/
There you can add platform app. When you do that, there is the download button for google-services.json


#5

Thanks i have found it


#6

so according to installation documentation on https://github.com/phonegap/phonegap-plugin-push/blob/master/docs/INSTALLATION.md#android-details

You should be get google-services.json from your Firebase console and put it in your root directory and then add this resource-file reference to config.xml :

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

GoogleAnalytics Error
#7

To download a config file
Sign in to Firebase and open your project.
Click the Settings icon and select Project settings.
In the Your apps card, select the package name of the app you need a config file for from the list.
Click google-services.json.


#8

For anyone using codova-android >= 7, you now must add

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

#9

iam using ionic v1. and i had included the required lines in the build.grade file. what should i do next?