I have a Cordova app with Android and iOS, and I am trying to add FCM so I can send push notification. I have followed the setup instructions on the site multiple times and continue to get the same build error.
Here is the error I get when I run Cordova build
FAILURE: Build failed with an exception.
* Where:
Build file 'C:\Users\Me\workspace\App\platforms\android\build.gradle' line: 326
* What went wrong:
A problem occurred evaluating root project 'android'.
> Failed to apply plugin [id 'com.google.gms.google-services']
> For input string: "+"
This is what is on the last line of the build.gradle file apply plugin: 'com.google.gms.google-services'
, which is what the setup instruction says to do.
I have made an account, got my package name from AndroidManifest.xml
, then added the google-services.json
to the main in the Android project, and then added the 3 lines in the build.gradle
file, but I continue to get this error.
What am I doing wrong? Thanks for the help.
I had similar issues.
My fix was to edit ./platforms/android/project.properties
I changed the + to 10.0.1 on all the google services. (make sure the SDK is up-to-date)
ie:
cordova.system.library.1=com.google.android.gms:play-services-analytics:+
to
cordova.system.library.1=com.google.android.gms:play-services-analytics:10.0.1
Do a build and all worked.
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