Comments (25)
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!
from cordova-plugin-firebase-analytics.
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.
from cordova-plugin-firebase-analytics.
Thanks @CookieCookson
That solution gives the following error:
Could not get unknown property 'FIREBASE_VERSION' for object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
Of course, still, removing the analytics plugin manages to build
from cordova-plugin-firebase-analytics.
6.2.3 same error
from cordova-plugin-firebase-analytics.
In case it helps anyone, I currently have everything working with following versions:
Cordova - 7.1.0 (backed off from 8 due to compatibility issues with some plugins (sorry, can't remember which ones)
phonegap-plugin-push - 2.1.3
cordova-plugin-firebase-analytics - 0.12.1
Also important was to install the plugins with the following commands (note the variables):
cordova plugins add cordova-plugin-firebase-analytics --variable FIREBASE_VERSION="11.6.2"
cordova plugins add phonegap-plugin-push --variable FCM_VERSION="11.6.2"
from cordova-plugin-firebase-analytics.
Me too facing the same problem with the cordova-plugin-fcm and cordova-plugin-firebase-analytics
plugins so I switched to another plugin.
For Android use this pluing: (Working well only with andriod not showing notification in ios)
https://www.npmjs.com/package/cordova-plugin-firebase
cordova plugin add [email protected] --save
For IOS:
Searching for solution...
from cordova-plugin-firebase-analytics.
@mailtoamirjohn Thanks, I can't have a partial solution so I'll wait for a response
from cordova-plugin-firebase-analytics.
@AmitMY I've had conflicts with this plugin too, you will have to fork one (or more) of the plugins that have conflicting libraries and make the library versions match rather than conflict. See here for how I got it to play along with phonegap-plugin-push and cordova-plugin-admob-pro.
I locked all of the plugins to 11.0.1 and it didn't seem to have any adverse side effects as they were all around that version anyway.
from cordova-plugin-firebase-analytics.
from cordova-plugin-firebase-analytics.
Thanks @CookieCookson
I created a 11.0.1 version of fcm, but still same error.
Full log:
ANDROID_HOME=C:\Program Files (x86)\Android\android-sdk
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_131
Reading build config file: D:\dev\apps\humhum\build.json
Starting a Gradle Daemon, 1 incompatible and 1 stopped Daemons could not be reused, use --status for details
:wrapper
BUILD SUCCESSFUL
Total time: 11.374 secs
Subproject Path: CordovaLib
google-services plugin could not detect any version for com.google.android.gms or com.google.firebase, default
version: 9.0.0 will be used.
please apply google-services plugin at the bottom of the build file.
The Task.leftShift(Closure) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use
Task.doLast(Action) instead.
at build_hmeztw3cfkd79acx8eubooco.run(D:\dev\apps\humhum\platforms\android\build.gradle:143)
The JavaCompile.setDependencyCacheDir() method has been deprecated and is scheduled to be removed in Gradle 4.0.
Incremental java compilation is an incubating feature.
The TaskInputs.source(Object) method has been deprecated and is scheduled to be removed in Gradle 4.0. Please
use TaskInputs.file(Object).skipWhenEmpty() instead.
Download https://maven.google.com/com/google/firebase/firebase-analytics/11.0.1/firebase-analytics-11.0.1.pom
Download
https://maven.google.com/com/google/firebase/firebase-analytics-impl/11.0.1/firebase-analytics-impl-11.0.1.pom
Download
https://maven.google.com/com/google/android/gms/play-services-basement/11.0.1/play-services-basement-11.0.1.pom
Download https://maven.google.com/com/google/firebase/firebase-common/11.0.1/firebase-common-11.0.1.pom
Download https://maven.google.com/com/google/firebase/firebase-iid/11.0.1/firebase-iid-11.0.1.pom
Download
https://maven.google.com/com/google/android/gms/play-services-tasks/11.0.1/play-services-tasks-11.0.1.pom
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'android'.
> Cannot add task ':processDebugGoogleServices' as a task with that name already exists.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 8.456 secs
Error: cmd: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'android'.
> Cannot add task ':processDebugGoogleServices' as a task with that name already exists.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
from cordova-plugin-firebase-analytics.
@HeatherWolford - this sounds like a suitable temporary workaround for now, as the libs are similar versions we can hope it doesn't cause any version mismatch errors. To implement a fix for this, it is probably recommended that the 3.0.0 dependency is removed from cordova-plugin-fcm and the plugin uses the cordova-support-google-services dependency. You can do this following my advice from above and creating a clone/fork of the initial repo and making the necessary changes for this.
from cordova-plugin-firebase-analytics.
Does anyone have working forks to use that are using the correct versions for no mismatch?
from cordova-plugin-firebase-analytics.
Also have a same problem... If you use fcm plugin alone with google service 9.0 that will cause problem with crash apps on some Samsung device.
Didi you try CookieCookson solution?
from cordova-plugin-firebase-analytics.
I tried the 3.1.0, using these forks:
<plugin name="cordova-plugin-fcm" spec="https://github.com/AmitMY/cordova-plugin-fcm-11.0.1.git" />
<plugin name="cordova-plugin-firebase-analytics" spec="https://github.com/Elixel/cordova-plugin-firebase-analytics-firebase-core-11.0.1.git" />
It now errors, with:
BUILD FAILED in 3m 7s
Found com.google.firebase:firebase-core:11.0.1, but version 9.0.0 is needed for the google-services plugin.
Found com.google.firebase:firebase-messaging:+, but version 9.0.0 is needed for the google-services plugin.
:processDebugGoogleServices FAILED
11 actionable tasks: 11 executed
Error: cmd: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':processDebugGoogleServices'.
> Please fix the version conflict either by updating the version of the google-services plugin (information about the latest version is available at https://bintray.com/android/android-tools/com.google.gms.google-services/) or updating the version of com.google
.android.gms to 9.0.0.
from cordova-plugin-firebase-analytics.
Strange, not got that happening here. What version of cordova-android
are you running?
from cordova-plugin-firebase-analytics.
6.4.0
from cordova-plugin-firebase-analytics.
I've not made the plunge yet to 6.4.0, I know it has some major changes - can you try with cordova-android
6.2.3 or 6.3.0?
from cordova-plugin-firebase-analytics.
I get this error also on 6.2.3
from cordova-plugin-firebase-analytics.
@AmitMY @michaeljcoyne this seems to be an issue with the latest version of the plugin and not related to this issue as such (it was added in a commit for version 0.12.1) and is also reported here: #55
Try installing the previous version of the plugin using cordova plugin add [email protected]
and see if you still get the problem.
from cordova-plugin-firebase-analytics.
@CookieCookson I'm getting the same issue but I'm using phonegap-plugin-push (probably works the same). I tried switching to 0.12.0 and that solved the issue. So you're likely correct that it was introduced in 0.12.1.
from cordova-plugin-firebase-analytics.
@AmitMY I got the same error.
from cordova-plugin-firebase-analytics.
I am using this plugin , It works fine in both android and ios.
from cordova-plugin-firebase-analytics.
@mailtoamirjohn Is there any way you can let us know which versions of each plugin and Cordova you're using?
from cordova-plugin-firebase-analytics.
I'm also having the same problem.
$ cordova --version
8.0.0
$ cordova plugins ls | grep phonegap-plugin-push
phonegap-plugin-push 2.0.0-rc1 "PushPlugin"
I'll look into upgrading phonegap-plugin-push to see if that solves anything. @mailtoamirjohn what phonegap-plugin-push version are you using?
from cordova-plugin-firebase-analytics.
The conflict will be fixed after merging of fechanique/cordova-plugin-fcm#495
from cordova-plugin-firebase-analytics.
Related Issues (20)
- [Action Required] Update your Firebase Performance Monitoring SDKs before January 10, 2022 HOT 1
- Duplicate resources google_app_id google_app_key HOT 1
- Problem in FirebaseAnalytic HOT 3
- Building IOS Capacitor 3 - CordovaPlugins Error - Undefined symbol: _OBJC_CLASS_$_FIRAnalytics HOT 11
- Disable automatic collection of events HOT 3
- Need support for e-commerce items (i.e. products) for Firebase Analytics HOT 2
- Plugin doesn't support this project's cordova version HOT 4
- CocoaPods could not find compatible versions for pod "GoogleUtilities/AppDelegateSwizzler"
- Conflict with FCM
- Unable to build project for iOS and Android after adding Firebase Analytics Plugin
- Localstorage not working
- Release notes?
- Library expects a BoM package: com.google.firebase:firebase-analytics HOT 4
- Broken on Capacitor HOT 1
- Android - Data do not send to firebase analytics HOT 6
- Failed to install firebase-analytics in iOS HOT 4
- cordova-plugin-firebase-analytics version 7.0.5 is not working for android platform HOT 2
- EXCEPTION: TypeError: Cannot read properties of undefined (reading 'split') HOT 1
- restrict the events based on bundle id
- Logged Event not reflected in firebase events console. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cordova-plugin-firebase-analytics.