question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Firebase plugins has a conflict (fcm and analytics)

See original GitHub issue

Installing both cordova-plugin-fcm and cordova-plugin-firebase-analytics result in an error that does not allow building using cordova.

Cannot add task ‘:processDebugGoogleServices’ as a task with that name already exists.

(x-issue: https://github.com/fechanique/cordova-plugin-fcm/issues/398)

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:2
  • Comments:25 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
CookieCooksoncommented, Nov 12, 2017

I had a chance to sit down and give this a go myself today. Managed to get the build to compile with minimal changes to the originals!

My steps were:

ionic start blank
cordova platform add android
cordova plugin add cordova-plugin-fcm # stock plugin from npm
# add valid google-services.json
cordova plugin add cordova-plugin-firebase-analytics # stock plugin from npm
cordova build android --device
# compiler shows error as above

I modified dev-build.gradle on cordova-support-google-services so it using google-services:3.0.0 instead of 3.1.0 as suggested above, and then after doing cordova build android --device then it compiles successfully! So you only need to modify cordova-support-google-services and none of the library versions for firebase.

2reactions
ghostcommented, Nov 7, 2017

I am also experiencing the same, and also posted this under Issue #51.

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 the 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.

Any guidance you can offer would be extremely helpful.

Thank you!

Read more comments on GitHub >

github_iconTop Results From Across the Web

'Push' and 'Firebase Analytics' plugin conflict
Hello, I'm struggling on building an app that has two native plugins that uses google services. It seems to be some gradle dependency ......
Read more >
Firebase Android SDK Release Notes
Service or Product, Gradle dependency, Latest version, Add Analytics? Firebase Android BoM (Bill of Materials), com.google.firebase:firebase-bom.
Read more >
Ionic 5 : Can't use FCM Plugin : Google Firebase Cloud ...
I am a very new beginner on Android. I have no control over the configuration of Android files. What is the reason for...
Read more >
Release Notes - Play services
Firebase Performance Monitoring Gradle plugin; Firebase Realtime Database; Firebase Remote Config; Firebase installations; Firebase SDK for Google Analytics.
Read more >
cordova-plugin-firebase-plus
This plugin is a fork of cordova-plugin-firebase which has been rework to fix ... It brings push notifications, analytics, event tracking, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found