ostownsville / cordova-plugin-fcm

Google FCM Push Notifications Cordova Plugin
21 stars 17 forks source link

Build fails with Mauron85 background location plugin #9

Closed luigi37 closed 6 years ago

luigi37 commented 6 years ago

Hi, I'm getting this at cordova run android :

Error: /home/myapp/platforms/android/gradlew: Command failed with exit code 1 Error output:
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':processDebugGoogleServices'.
> Please fix the version conflict either by updating the version of the google-services plugin (information about the latest version is available at https://bintray.com/android/android-tools/com.google.gms.google-services/) or updating the version of com.google.android.gms to 9.0.0.

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

I've been looking around and it's certanly linked to this other plugin https://github.com/mauron85/cordova-plugin-background-geolocation

I tried a ton of different alternatives but could not get this away.

Any suggestion? Thanks Luigi

chrisjpalmer commented 6 years ago

Hi Luigi. Im going to ask the stupid question: Have you tried updating your android SDK? If you go to your terminal and type android, you will be able to access the android SDK manager. Then you can update Google Play Services.

If you still need help, let us know.

luigi37 commented 6 years ago

Yep. tried. All is up to date but the issue seems to come from the settings in various build.gradle and plugin.xml files. After trying many more options, I've found this one to work properly: https://forum.ionicframework.com/t/google-services-version-conflict-maps-fcm/93695/15

It's not optimal as it requires a manual tweak to platform/android/build.gradle (in add to a couple of changes to both mauron85 and cordova-plugin-fcm repositories).

Other plugins (than mauron85) seems not to be affected...

CowboyCode commented 6 years ago

@luigi37 In ionic, the gradle stuff is all generated from the plugin.xmls.

Look at this file https://github.com/mauron85/cordova-plugin-background-geolocation/blob/master/android/build.gradle

You can try to upgrade the tools using classpath 'com.android.tools.build:gradle:2.3.3'

https://developer.android.com/studio/releases/gradle-plugin.html

All those outdated repos that no one looks after anymore... You may fork it the geo plugin and change that line and install from your repo for testing. I am pretty sure that this will get you on the right track.

Cheers

luigi37 commented 6 years ago

Perfect, thanks CowboyCode, I will give it a try as it would be much cleaner solution

CowboyCode commented 6 years ago

@luigi37 You may have to replace the outdated distributionUrl = https\://services.gradle.org/distributions/gradle-3.3-all.zip

in platforms/android/app/gradle.settings (or so, just get that out of the top of my head :-) )

CowboyCode commented 6 years ago

I close this issue for now, let me know if there are still issues

luigi37 commented 6 years ago

Hi, yes the issue is still there... I think it's anyway linked to this: [ostownsville/cordova-plugin-fcm] Android Firebase and Google Services - Out Of Date (#14) https://github.com/ostownsville/cordova-plugin-fcm/issues/14