File google-services.json is missing

I am trying to implement “cordova-plugin-firebase-analytics” and it is giving error as

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

I have added google-services.json file in root as well as in src folder but noting worked, Also tried adding below code

<platform name="android">
    <edit-config file="AndroidManifest.xml" mode="merge" target="/*/application" ></edit-config>        
</platform>

Or

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

but noting worked, Can anyone help? Anyone faced same issue?

Is your google-services.json file at the same level as config.xml in your project folder?

Yes, It is on the same level
I resolved the issue, I need to place the file in both root as well as in the www folder. I am not sure why will test more and let know.

I think I have this same problem. However, the above solution doesn’t seem to work for me.

I keep getting this on my android app build.

UserError: FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ‘:app:processReleaseGoogleServices’. > File google-services.json is missing. The Google Services Plugin cannot function without it. See log for full details.

I have my google services file in there at all the location stated above. Same error.

This starts as a similar problem, but has a different solution. In your config.xml, you use this plugin:

<plugin name="phonegap-plugin-push" />

If you go to the docs for this plugin, there is this warning:

DEPRECATED

This project is not under active development. Folks who are users of this plugin should switch to using cordova-plugin-push which is a fork of this project.

Another thing I noticed is that the docs call for this in your config.xml file:

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

That’s missing, and is probably the reason that file cannot be found.

Are you using the below plugin for analytics or a different one?

<plugin name="cordova-plugin-firebase-analytics" source="npm">
    <variable name="PLAY_SERVICES_VERSION" value="17.0.0" />
</plugin>