Closed jvjvjv closed 6 years ago
The issue occurs on @2.0.0-rc5 right now (and likely previous releases of 2.0.0). This issue isn't a priority requirement.
I don't use the phonegap push plugin so I am not familiar with this issue. I have seen one other similar issue #72 but a workaround provided had hard coded versions in the gradle file which I don't want to be merged into master but maybe it will solve your problem. You might want to post to phonegap push plugin also and see if there are incompatibilities with other plugins also since I am sure many others are using google play services. If you find a standard solution that works, I welcome pull requests. If so, please reopen this issue. Thanks!
Actually I'll leave it open in case others have a suggestion
Then it may be a phonegap push plugin issue, but I have a feeling it's an issue caused by using Firebase, where google services must be a specific version, so either a) everyone has to update their plugins for this one, or b) phonegap push plugin has to post hackish workarounds for version 2+.
The config this plugin uses for including google play services does not include a version which I would think would result in fewer version conflicts since no specific version is being required.
IMO the problem is in neither the analytics nor in the push or fcm plugins, but in how Cordova handles plugin versioning in general. You see there may be many plugins in your project, all with different or specific version dependencies and it is totally unclear how to set a common version to all 3rd party plugins when building your Cordova project. I believe Cordova does not have a real answer to that at the moment, however I'd welcome a correction. ;)
That being said, here is one possible solution.
plugins
and platforms
folders.cordova plugin add ...
platforms/
directory is empty.plugins/com.cmackay.plugins.googleanalytics/plugin.xml
and change the following line: <framework src="com.google.android.gms:play-services-analytics:+" />
to
<framework src="com.google.android.gms:play-services-analytics:11.0.1" />
cordova platform add android
Try this and see if the build gets any further.
EDIT: Why the 11.0.1
? That's what phonegap-plugin-push seems to be using. Ah yeah, the whole rebranding of play-services to firebase from Google's side makes the whole mess even worse. 😉
Thanks @petarov for your comments. I completely agree. I don't see this as something we can fix in this plugin. I appreciate your detailed notes for a potential workaround for users. :)
Thanks for the advice, everyone. Sounds like I'll just branch this to "fix" it directly in my project for now. I'll leave it at your discretion to close or leave open.
I'll leave it open and mark it wontfix. If someone does find a good way to resolve this, please post any suggestions here :) Thanks!
@petarov I haven't even tried your suggestion yet (been out of time lately) but I fully believe your suggestion will work. I appreciate your detailed notes and potential workaround as well.
Did anybody find a solution to this problem? Every time a project is built, a change needs to be made in project.properties file and the version number of com.google.android.gms:play-services-analytics needs to be changed from + to 11.0.1. Is there any possible way to avoid making this change every time a project is built?
I am not aware of any good solutions for it. If you find one, feel free to submit a PR. I am sure others would appreciate it.
@cmackay I think I got something. I'll open a PR to check with you.
That looks like a good solution for this. I appreciate you submitting the PR. I should have it merged and released later on today. Thanks @petarov !
The changes are now published in version 1.0.3. I tested it out a bit and things seem to be working well. Thanks again @petarov for making this change :)
Awesome! Cheers 🍻
Hi.
When both this plugin and the phonegap-plugin-push plugin are installed in the project, building to Android provides the following error message.
I mention it here and not there as I believe this plugin is out of date, being updated seven months ago, whereas the latest release of the other plugin is a month ago.