google / play-services-plugins

Plugins to help with using Google Play services SDK.
https://developers.google.com/android/guides/overview
Apache License 2.0
453 stars 134 forks source link

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

Closed PedroDousseau closed 1 month ago

PedroDousseau commented 4 years ago

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.

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.

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"

ronaldalfaro commented 4 years ago

Hi, have you resolved this issue? I'm getting same problem in IONIC....

lochsenfeld commented 4 years ago

Same here

vpetkar2 commented 4 years ago

Same here..

sperzion commented 4 years ago

This issue should probably be filed with the cordova-support-google-services project: https://github.com/chemerisuk/cordova-support-google-services

damsorian commented 4 years ago

any solution?

ga27 commented 3 years ago

same here

ga27 commented 3 years ago

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