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.

‘Push’ and ‘Firebase Analytics’ plugin conflict on Ionic

See original GitHub issue

Hello,

I’m struggling on building an Ionic app that has two native plugins that uses google services.

It seems to be some gradle dependency conflict, I’m new to mobile development, it would be great if you guys could show me why this problem is happening. I’m following the oficial Ionic documentation and completely lost on how to handle this type of error.

Steps to reproduce it:

  1. Create some ionic-angular project “ionic start someProjectName super --type=ionic-angular”

  2. Add the ‘Push’ native plugin to the project exactly like the documentation (https://ionicframework.com/docs/v3/native/push/)

“ionic cordova plugin add phonegap-plugin-push” “npm install --save @ionic-native/push@4

  1. Add the ‘Firebase analytics’ native plugin to the project exactly like the documentation (https://ionicframework.com/docs/v3/native/firebase-analytics/)

“ionic cordova plugin add cordova-plugin-firebase-analytics” “npm install --save @ionic-native/firebase-analytics@4

  1. Add the android platform

“ionic cordova platform add android”

  1. Create a firebase project and put the google-services.json inside platforms/android/app

  2. Try to build it for android

“ionic cordova build android”

Then, you will get this log:

`[10:40:03] ionic-app-scripts 3.2.4 [10:40:03] build dev started … [10:40:03] clean started … [10:40:03] clean finished in 10 ms [10:40:03] copy started … [10:40:05] deeplinks started … [10:40:05] deeplinks finished in 115 ms [10:40:05] transpile started … [10:40:18] transpile finished in 13.22 s [10:40:18] preprocess started … [10:40:18] preprocess finished in 1 ms [10:40:18] webpack started … [10:40:19] copy finished in 15.60 s [10:40:26] webpack finished in 8.32 s [10:40:26] sass started … [10:40:30] sass finished in 3.29 s [10:40:30] postprocess started … [10:40:30] postprocess finished in 38 ms [10:40:30] lint started … [10:40:30] build dev finished in 27.01 s [10:40:37] lint finished in 7.72 s

cordova.cmd build android Checking Java JDK and Android SDK versions ANDROID_SDK_ROOT=undefined (recommended setting) ANDROID_HOME=D:\Users\ALUNOS\AppData\Local\Android\Sdk (DEPRECATED) Task :wrapper

BUILD SUCCESSFUL in 2s 1 actionable task: 1 executed Subproject Path: CordovaLib Subproject Path: app

Configure project :app registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection) registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)

Task :app:preBuild UP-TO-DATE Task :CordovaLib:preBuild UP-TO-DATE Task :CordovaLib:preDebugBuild UP-TO-DATE Task :CordovaLib:checkDebugManifest Task :CordovaLib:processDebugManifest

Task :app:preDebugBuild FAILED Dependency resolved to an incompatible version: Dependency(fromArtifactVersion=ArtifactVersion(groupId=com.google.firebase, artifactId=firebase-messaging, version=17.0.0), toArtifact=Artifact(groupId=com.google.firebase, artifactId=firebase-iid), toArtifactVersionString=[16.0.0]) 3 actionable tasks: 3 executed

FAILURE: Build failed with an exception.

  • What went wrong: Failed to capture fingerprint of input files for task ‘:app:preDebugBuild’ property ‘compileManifests’ during up-to-date check.

In project ‘app’ a resolved Google Play services library dependency depends on another at an exact version (e.g. “[16.0. 0]”, but isn’t being resolved to that version. Behavior exhibited by the library will be unknown.

Dependency failing: com.google.firebase:firebase-messaging:17.0.0 -> com.google.firebase:firebase-iid@[16.0.0], but fire base-iid version was 19.0.0.

The following dependencies are project dependencies that are direct or have transitive dependencies that lead to the art ifact with the issue. – Project ‘app’ depends onto com.google.firebase:firebase-messaging@17.0.+ – Project ‘app’ depends onto com.google.firebase:firebase-analytics@17.2.1 – Project ‘app’ depends onto com.google.firebase:firebase-iid@19.0.0 – Project ‘app’ depends onto com.google.firebase:firebase-analytics@17.2.+ – Project ‘app’ depends onto com.google.android.gms:play-services-measurement-api@17.2.1 – Project ‘app’ depends onto com.google.firebase:firebase-messaging@17.0.0

For extended debugging info execute Gradle from the command line with ./gradlew --info :app:assembleDebug to see the dep endency paths to the artifact. This error message came from the google-services Gradle plugin, report issues at https:// github.com/google/play-services-plugins and disable by adding “googleServices { disableVersionCheck = false }” to your b uild.gradle file.

  • Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

BUILD FAILED in 7s D:\Users\ALUNOS\Desktop\AT\Desenvolvimento\Apps\teste-analytics-2\someProjectName\platforms\android\gradlew: Command failed with exit code 1 Error output: FAILURE: Build failed with an exception.

  • What went wrong: Failed to capture fingerprint of input files for task ‘:app:preDebugBuild’ property ‘compileManifests’ during up-to-date check.

In project ‘app’ a resolved Google Play services library dependency depends on another at an exact version (e.g. “[16.0. 0]”, but isn’t being resolved to that version. Behavior exhibited by the library will be unknown.

Dependency failing: com.google.firebase:firebase-messaging:17.0.0 -> com.google.firebase:firebase-iid@[16.0.0], but fire base-iid version was 19.0.0.

The following dependencies are project dependencies that are direct or have transitive dependencies that lead to the art ifact with the issue. – Project ‘app’ depends onto com.google.firebase:firebase-messaging@17.0.+ – Project ‘app’ depends onto com.google.firebase:firebase-analytics@17.2.1 – Project ‘app’ depends onto com.google.firebase:firebase-iid@19.0.0 – Project ‘app’ depends onto com.google.firebase:firebase-analytics@17.2.+ – Project ‘app’ depends onto com.google.android.gms:play-services-measurement-api@17.2.1 – Project ‘app’ depends onto com.google.firebase:firebase-messaging@17.0.0

For extended debugging info execute Gradle from the command line with ./gradlew --info :app:assembleDebug to see the dep endency paths to the artifact. This error message came from the google-services Gradle plugin, report issues at https:// github.com/google/play-services-plugins and disable by adding “googleServices { disableVersionCheck = false }” to your b uild.gradle file.

  • Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

BUILD FAILED in 7s [ERROR] An error occurred while running subprocess cordova.

    cordova.cmd build android exited with exit code 1.

    Re-running this command with the --verbose flag may provide more information.`

If you skip step 3 by not adding analytics plugin, you should be fine on building it, the problem is occuring when both plugins are installed.

Gradle: 6.0.1 Android SDK Tools: 26.1.1 Cordova CLI : 9.0.0

Plugin list: cordova-plugin-firebase-analytics 4.0.1 “FirebaseAnalyticsPlugin” cordova-support-android-plugin 1.0.1 “cordova-support-android-plugin” cordova-support-google-services 1.3.2 “cordova-support-google-services” phonegap-plugin-multidex 1.0.0 “Multidex” phonegap-plugin-push 2.3.0 “PushPlugin”

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:1
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
ronaldalfarocommented, Feb 6, 2020

Hi, have you resolved this issue? I’m getting same problem in IONIC…

0reactions
ga27commented, Jul 1, 2020

My “solution” was comment googleServices { disableVersionCheck = true } in the end of app build.gradle file

Read more comments on GitHub >

github_iconTop Results From Across the Web

Firebase plugins has a conflict (fcm and analytics) #50 - GitHub
I am new to using Ionic 3/Angular 4. A fix I had found on a different forum, and implemented, was changing the version...
Read more >
Firebase analytics and push notification plugin clash
I have this Ionic 3 mobile application which needs firebase analytics and firebase push notification, both the plugins integrated.
Read more >
Conflict between cordova-plugin-firebasex ... - Stack Overflow
As the project is being built, the build process will try to fetch the analytics package for you and it would fail to...
Read more >
cordova-plugin-firebasex - npm
Brings push notifications, analytics, event tracking, crash reporting and more from Google Firebase to your Cordova project.
Read more >
Ionic Forum - Latest posts - RSSing.com
ionic cordova plugin add cordova-plugin-firebase-messaging npm install ... Previous 'Push' and 'Firebase Analytics' plugin conflict. 0. 0. Ionic 5 is out ...
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