chemerisuk / cordova-support-google-services

DEPRECATED. Cordova plugin to add google services support
MIT License
41 stars 106 forks source link

Dependency conflict #1

Closed ghost closed 6 years ago

ghost commented 7 years ago

When I run: cordova build android I get the following: What went wrong: A problem occurred configuring root project android. Cannot add task :processDebugGoogleServices' as a task with that name already exists.

I am attempting to use Firebase Analytics (cordova-plugin-firebase-analytics) which requires your plugin, Google Services (cordova-support-google-services). I am also using Firebase Cloud Messaging (cordova-plugin-fcm). The cordova-plugin-fcm includes Google Services 3.0.0 and the cordova-support-google-services has Google Services at 3.1.0 creating the conflict.

I am new to using Ionic 3/Angular 4. A fix I had found on a different forum, and implemented, was changing the version in platforms/android/cordova-support-google-services to 3.0.0 from 3.1.0. This was only a temporary fix, and a Sr. Dev on my team said this was terrible and should never be done. Of course, I do not want to do something that is a bad practice, however, what this error informed me of is that if I can get the dependencies at the same version, then the conflict resolves and the project builds.

Do you have an earlier plugin that has Google Services at 3.0.0 or is there a way to specify the version of Google Services at the time of installation? Any guidance you can offer would be extremely helpful.

Thank you!

phonic commented 6 years ago

Look for any "firebase-core:11.0.x" entry in platform/android/project.properties and build.gralde and change it to "firebase-core:11.0.1"

In addition: Make sure your android build tools are up to date

run "gradlew assembleDebug --info" from your platforms/android/ directory to see any further specific error.

macdonst commented 6 years ago

@HeatherWolford I think you'd need to send a PR to the maintainer of cordova-plugin-fcm to use this plugin to run the Google Services gradle task.

chemerisuk commented 6 years ago

@macdonst does it make sense to create a PR to https://github.com/phonegap/phonegap-plugin-push, to use this repo as a dependency? Should solve some conflicts that people might have. Or there are some plans to integrate google services task into cordova-android?

macdonst commented 6 years ago

@chemerisuk yeah, I'd be cool with a PR to the push plugin. It should make things more consistent if we only have one plugin adding this step.

macdonst commented 6 years ago

I sent a PR to cordova-plugin-fcm but I'm not sure if the plugin is even maintained anymore.

chemerisuk commented 6 years ago

The conflict will be fixed after merging of https://github.com/fechanique/cordova-plugin-fcm/pull/495