1
votes

I just installed the cordova firebase analytics plugin from (https://github.com/chemerisuk/cordova-plugin-firebase-analytics) but there seems to be a problem finding the google-services.json file.

This file is in the root of the Ionic project and has not caused me any trouble up until now. I have been using the cordova-plugin-firebase and angular fire 2 plugin with no trouble beforehand.

What went wrong: Execution failed for task ‘:app:processDebugGoogleServices’. File google-services.json is missing. The Google Services Plugin cannot function without it. Searched Location: C:\Users\User1\WebstormProjects\IONIC\Projects\myApp\platforms\android\app\src\nullnull\debug\google-services.json C:\Users\User1\WebstormProjects\IONIC\Projects\myApp\platforms\android\app\src\debug\nullnull\google-services.json C:\Users\User1\WebstormProjects\IONIC\Projects\myApp\platforms\android\app\src\nullnull\google-services.json C:\Users\User1\WebstormProjects\IONIC\Projects\myApp\platforms\android\app\src\debug\google-services.json C:\Users\User1\WebstormProjects\IONIC\Projects\myApp\platforms\android\app\src\nullnullDebug\google-services.json C:\Users\User1\WebstormProjects\IONIC\Projects\myApp\platforms\android\app\google-services.json

1

1 Answers

0
votes

I assume you added your google-services.json services to your project's root.

In the platform tag for Android add the following resource-file tag if you are using cordova-android 7.0 or greater:

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

If you are using cordova-android 6.x or earlier, add the following resource-file tag:

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

Also make sure that dependent plugins, specially cordova-support-google-services, is installed with latest version 1.2.0.

As a side note, those Firebase plugins from chemerisuk tend to have these type of Cordova errors and warnings, which are a pain to fix. I've been dealing with his Firebase Auth plugin which shows identical errors, the funny thing is that plugin and app work just fine anyway.