I am using FCM for push notification I always get this error message
"File google-services.json is missing. The Google Services Plugin cannot function without it ionic 3"
on phone I have placed my google-services.json on every folder and nothings working
Fist of all you need to download google-services.json:
(https://support.google.com/firebase/answer/7015592)
Ok now you have to install cordova-support-google-services:
cordova plugin add cordova-support-google-services --save
Then, you have to put the google-services.json in the root of your project (outside www folder, at the same level), and then the resource-file tag will copy it to platforms/android/app/
Next, put in the config.xml
<platform name="android">
<resource-file src="google-services.json" target="app/google-services.json" />
...
</platform>
Note: if you use cordova-android below version 7 specify instead:
target="google-services.json"
Now try again to build!
As mentioned before google-services.json
needs to be copied to the proper location. the location changed recently to app/google-services.json
. So the config.xml
needs to be adapted accordingly to
<resource-file src="google-services.json" target="app/google-services.json" />
Lets' assume you put the google-services.json in src/app folder So relativly to your ionic project it is located at src/app/google-services.json
Now, to be sure it will be copied to the correct location of the build, you have to add a line of code to the config.xml file.
<resource-file src="src/app/google-services.json" target="app/google-services.json" />
Note that the src property of this line should reflect the relative path of the google-service.json file accordingly.
That's as simple as that
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With