I was using Cordova Plugin Firebase package for push notifications and it works pretty well.
But today got the error while building the build for Android.
This is the error message I got when running the project
The library com.google.android.gms:play-services-measurement-base is being requested by various other libraries at [[16.5.0,16.5.0], [16.4.0,16.4.0]], but resolves to 16.5.0. Disable the plugin and check your dependencies tree using ./gradlew :app:dependencies.
Also, On Github this is an open issue. Although, few of the users commenting that they have succesfully counter the issue but their solution not working for me.
Also, Can anyone tell me how to create a project.properties files while building the app for Cordova? I am asking this because some of the users mention adding the project.properties file in their project solves the issue.
Add cordova-play-services-version-adapter plugin…I think it tries to resolve the play services versions requested by various plugins. It solves my firebase problem.
I got this error before starting the App and then the same error
‘Cordova Play Services Version Adapter’ has detected an error. The following dependencies of ‘Google Play Services’ are not compatible:
You have an incompatibility of versions with the following dependencies of ‘Google Play Services’:
- ‘com.google.android.gms:play-services-auth:11.8.0’
- ‘com.google.android.gms:play-services-identity:11.8.0’
- ‘com.google.android.gms:play-services-tagmanager:+’
- ‘com.google.firebase:firebase-core:+’
- ‘com.google.firebase:firebase-messaging:+’
- ‘com.google.firebase:firebase-config:+’
- ‘com.google.firebase:firebase-perf:+’
It doesn’t exists a version of ‘Google Play Services’ that includes all these dependencies.
All dependencies of ‘Google Play Services’ must have the same version.
The application may not compile.
BUILD FAILED in 2m 17s
{ Error: /usr/Data/Meteor/sn_aws-web/.meteor/local/cordova-build/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.
FAILURE: Build failed with an exception.
What went wrong:
The library com.google.android.gms:play-services-measurement-base is being requested by various other libraries at [[16.5.0,16.5.0], [16.4.0,16.4.0]], but resolves to 16.5.0. Disable the plugin and check your
dependencies tree using ./gradlew :app:dependencies.
It does not work, can you please check whats the issue?
You may have to use adapters similar to one I have mentioned(check cordova-android-support-gradle-release or cordova-android-firebase-gradle-release - check their documentation), that helps sort the problem. it is trial and error and choosing the right version of plugin so that dependencies match
Hi,
in your Android project you need to add all those latest versions for Firebase messaging and the rest of the Android plugins in android/app/ build.gradle. For Firebase Messaging you might end up with 11… instead of 17. while the latests is 18 I believe.
In this Meteor Push package https://github.com/activitree/meteor-push I use cordova-android-support-gradle-release@1.4.5 to overcome this error you have now. However the latested version of this plugin is now 3+.
Great. But if it is editing project.properties …then it may not be the right solution. I would suggest exploring the right way of using cordova-android-support-gradle-release or the other as suggested above by passing the right parameters using mobile-config.js file using custom config plugin to the cordova plugins
I’m having this same problem now with cordova-plugin-firebase (actually I was using this fork but I’ve tried the original again and have the same problem)
The library com.google.firebase:firebase-iid is being requested by various other libraries at [[17.1.1,17.1.1]], but resolves to 19.0.0
@mixmatric, what solution worked for you in the end? Does it still work? What versions of the various packages are you using?
I’ve tried cordova:cordova-android-support-gradle-release@1.4.5 but get the error
I’ve tried editing the project.properties file with the version number above but still get lots of errors
@perumalkuk, how am I supposed to find the correct version of cordova-android-support-gradle-relese? Or what versions number am I support to pass in mobile-config, and how? I’ve done that previously in other apps, e.g.
But what values should be used for cordova-plugin-firebase?
This is extremely frustrating. I used to be able to build android apps easily but now I’m stuck not being able to update my app at all! And I’ve recommended meteor here on the forums as an easy way to develop apps. There are other forks of cordova-plugin-firebase and other similar packages but many of them require more recent versions for cordova or have these same issues.
Thank @perumalkuk, looks like that is working. I had to replace cordova-firebase-plugin with phonegap-plugin-push@2.2.3 which will mean re-writing some of my client code, but so far it seems to work (builds app, registers gcm token, next I’ll try receiving a push message…)
@mixmatric, I’m not finding phonegap-plugin-push as easy to use with iOS, so I’d like to try cordova-firebase-plugin again which was working perfectly for me previously. Can you post your .meteor/cordova-plugins file so I can see exactly which versions of plugins you got it working with?
I thought let me jump in …I actually use raix:push which uses phonegap-plugin-push, but found that it was not possible to use p8 so ended using apn for ios messages and continue to use raix:push for android