Closed kaynz closed 7 years ago
This occurs due to a Gradle version collision with another plugin: this plugin specifies com.google.android.gms:play-services-location:+
in its plugin.xml.
The simplest solution is to install cordova-android-play-services-gradle-release into your project, which will force all plugins in the project (including this one) to use the same version of Play Services.
Thanks. I'm getting the same error with cordova-android-play-services-gradle-release.
I'm using latest phonegap-plugin-push, latest cordova. Everything up2date. I cleared node_modules, platforms, plugin and set up everything from fresh. Same problem. What information do you need to find the problem? :)
What information do you need to find the problem?
Time. I'm flat out with work.
Try also adding @christocracy's new plugin to your project:
cordova plugin add google-api-version --variable GOOGLE_API_VERSION=11.+
I don't think there's a solution when some other plugin uses :+
. That blows it up.
Other plugins should at least provide the major version, eg: :11.+
. I had to do this for my background-geolocation-lt
yesterday.
Yes, the problem is here in this plugin. If that were changed to :11.+
, it should work.
@christocracy The Gradle config in your Google API version plugin (and my Play Services and App Support plugins) should override any versions requested by other plugins via their Gradle config. At least, that's what I found in testing cordova-android-support-gradle-release.
I'm keenly aware that if every plugin author sets their version to 11.+
then the world will explode when Google releases 12.+
and the first plugin author makes that change. My hope was that our Gradle plugins could be used to override whatever is configured in a 3rd party plugin so as to not rely on the author to update it - in this case, me!
It should. The problem is with plugins like phonegap-plugin-push which have to do stuff like this:
ext.postBuildExtras = {
apply plugin: com.google.gms.googleservices.GoogleServicesPlugin
}
This isn't normally how GoogleServicesPlugin
is installed in native apps. It's a hack to overcome the limitations of Cordova, which doesn't provide access to the global build.gradle
.
Normally, google-services-plugin
should be installed in the root build.gradle
like this:
apply plugin: 'com.google.gms.google-services' // <-- string reference
ext.postBuildExtras = { apply plugin: com.google.gms.googleservices.GoogleServicesPlugin }
That's a bit evil. phonegap-plugin-push
isn't one I have tested with this override mechanism, so I've been blissfully unaware of this scenario: the override has been working nicely for other plugins. It throws a bit a spanner in the Gradle override approach.
Ho hum, I'll try setting 11.+
for this one and see if it fixes the issue. At least that should fix it for @kaynz
cordova-plugin-fcm
as well.
OK, just tested locally and setting 11.+
does indeed work in this case.
@kaynz apologies, I wasn't aware of the Gradle hack used by phonegap-plugin-push
as described by @christocracy.
Will push out a patch release that fixes this in a few minutes...
Published as cordova-plugin-request-location-accuracy@2.2.2
Time. I'm flat out with work.
Sorry, I didn't mean to be rude.
@kaynz apologies, I wasn't aware of the Gradle hack used by phonegap-plugin-push as described by @christocracy.
I will have a look into https://github.com/dpa99c/cordova-android-play-services-gradle-release and phonegap-plugin-push. Maybe I can help you out with a fix for this problem.
Thanks for the workaround 👍
Same problem, in my case It was a issue with Firebase plugin and Firebase-Messaging plugin, I solved with these instructions:
ionic cordova plugin remove cordova-plugin-firebase && npm uninstall --save @ionic-native/firebase
rm -rf ./plugins
ionic cordova platform remove android && ionic cordova platform add android
Hope It helps
Hi,
I'm getting this error
with the latest version of this plugin.
You can find more info about the problem here: https://github.com/phonegap/phonegap-plugin-push/issues/1718