arnesson / cordova-plugin-firebase

Cordova plugin for Google Firebase
http://arnesson.github.io/cordova-plugin-firebase
MIT License
1.01k stars 1.56k forks source link

play-services-measurement-base version miss match #1066

Open daithi-coombes opened 5 years ago

daithi-coombes commented 5 years ago

Describe the bug Constistent version miss matches with com.google.android.gms:play-services-measurement-base, using quasar and cordova.

To Reproduce Steps to reproduce the behavior:

  1. Install plugin
  2. Run cordova (cordova run)

Expected behavior No google version miss matching.

Screenshots If applicable, add screenshots to help explain your problem.

Console Logs

The library com.google.android.gms:play-services-measurement-base is being requested by various other libraries at [[16.5.0,16.5.0], [16.4.0,16.4.0]], but resolves to 16.5.0. Disable the plugin and check your dependencies tree using ./gradlew :app:dependencies.

Plugin Version Run cordova plugin list to find out what version of cordova-plugin-firebase you are running with

cordova-plugin-extension 1.5.4 "Cordova Plugin Extension"
cordova-plugin-whitelist 1.3.3 "Whitelist"

Desktop (please complete the following information):

Smartphone (please complete the following information):

Additional context If I follow instructions and add the other two plugins, then I get the same error.

hjfigueira commented 5 years ago

+1

gregmille commented 5 years ago

+1

DrCorduroy commented 5 years ago

+1

yukinokaze commented 5 years ago

+1

sthurian commented 5 years ago

+1

TravisVincent commented 5 years ago

+1

Growiel commented 5 years ago

Getting the same issue right after installing this plugin:

The library com.google.android.gms:play-services-measurement-base is being requested by various other libraries at [[16.5.0,16.5.0], [16.4.0,16.4.0]], but resolves to 16.5.0. Disable the plugin and check your dependencies tree using ./gradlew :app:dependencies.

but in my case, Firebase is the ONLY module I have installed:

cordova plugin list
cordova-plugin-firebase 2.0.5 "Google Firebase Plugin"
TravisVincent commented 5 years ago

I got a solution that worked for me:

Open up build.gradle (app module)

And find dependencies. Replace the versions (that are most likely stated as "+") with:

compile "com.google.android.gms:play-services-tagmanager:16+"
compile "com.google.firebase:firebase-core:16.0.8"
compile "com.google.firebase:firebase-messaging:17.5.0"
compile "com.google.firebase:firebase-config:16.4.1"
compile "com.google.firebase:firebase-perf:16.2.4"
daithi-coombes commented 5 years ago

yes I had tried that from an issue in 2017 I found, but still the same result. Change there could'be been dead code in the cordova build though, so will recreate and test later ;)

daithi-coombes commented 5 years ago

@TravisVincent I was same. Posted cordova plugin list from wrong terminal. Have updated OP now.

bayanAbuawad commented 5 years ago

I had the same problem and this solution saved my day: https://stackoverflow.com/questions/56014935/problem-with-play-services-measurement-base-on-ionic

Virendrabaskar commented 5 years ago

Facing the same problem

daithi-coombes commented 5 years ago

@TravisVincent no joy, still getting:

Failed to capture fingerprint of input files for task ':app:preReleaseBuild' property 'compileManifests' during up-to-date check.         
> The library com.google.android.gms:play-services-measurement-base is being requested by various other libraries at [[16.5.0,16.5.0], [16.4.0,16.4.0]
], but resolves to 16.5.0. Disable the plugin and check your dependencies tree using ./gradlew :app:dependencies.

The cordova-plugin-firebase is resetting those versions back to +. Tried uninstalling the plugin but now it gives me:

$ cordova plugin remove cordova-plugin-firebase
Uninstalling cordova-plugin-firebase from android
Error during processing of action! Attempting to revert...
Uh oh!
ENOENT: no such file or directory, open '../quasar/src-cordova/platforms/android/app/src/main/AndroidManifest.xml'
daithi-coombes commented 5 years ago

seems I'm not only one that can't remove cordova-plugin-firebase: https://forum.ionicframework.com/t/cant-remove-firebase-plugin-from-project/132645

sulaymankhan commented 5 years ago

@daithi-coombes I was facing the same issue. I had to remove the platform and then the plugin: ionic cordova platform rm android ionic cordova plugin rm cordova-plugin-firebase and then add the platform again ionic cordova platform add android

TravisVincent commented 5 years ago

@daithi-coombes You can also try to change the plugin.xml for the plugin and set the versions to:

com.google.android.gms:play-services-tagmanager:16+
com.google.firebase:firebase-core:16.0.8
com.google.firebase:firebase-messaging:17.5.0
com.google.firebase:firebase-config:16.4.1
com.google.firebase:firebase-perf:16.2.4
outspokenmagazine commented 5 years ago

I agree with @TravisVincent you do need to edit the plugins.xml otherwise the build.gradle will get overwritten over and over again.

So here is what I did step by step:

remove these directories (after a fresh install not necessary) platforms node-modules plugins

then the following steps

  1. ionic cordova plugin add cordova-plugin-firebase --save
  2. open your plugins folder and find the plugins.xml within the firebase directory and open it
  3. replace the framework tags with the following

`

`

  1. ionic cordova platform add android
  2. ionic cordova build android
TravisVincent commented 5 years ago

@outspokenmagazine Don't forget that the --save does overwrite other custom made changes.

What i did was:

  1. edit the versions inside plugin.xml
  2. edit the versions inside build.gradle (app module)
  3. sync gradle again
  4. cordova build
  5. cordova build android

Overall a simple solution until the problem is fixed

Virendrabaskar commented 5 years ago

With this Pull Request build is getting successful https://github.com/arnesson/cordova-plugin-firebase/pull/1034

newuser44 commented 5 years ago

I had this working from this problem a month ago. The fix was to set the versions in the project.properties.
Have to do this any time I remove and add android.
My values are.
cordova.system.library.2=com.google.android.gms:play-services-tagmanager:+ cordova.system.library.3=com.google.firebase:firebase-core:16.0.8 cordova.system.library.4=com.google.firebase:firebase-messaging:17.5.0 cordova.system.library.5=com.google.firebase:firebase-config:16.4.1 cordova.system.library.6=com.google.firebase:firebase-perf:16.2.4 cordova.system.library.7=com.android.support:support-v4:24.1.1+

But today I'm getting an error in building.

The library com.google.firebase:firebase-iid is being requested by various other libraries at [[17.1.1,17.1.1]], but resolves to 19.0.0. Disable the plugin and check your dependencies tree using ./gradlew :app:dependencies.

I assume I need to update things again. To what?

daithi-coombes commented 5 years ago

I completely gave up on firebase. So happy I did now, no vendor lock-in :P

DokunCodes commented 4 years ago

Here's how i resolved mine:

  1. ionic cordova platform rm android
  2. ionic cordova plugin rm cordova-plugin-firebase
  3. ionic cordova plugin add cordova-plugin-firebase (you can skip step 2 if you've not installed the plugin before)
  4. Goto directory plugins -> cordova-plugin-firebase -> plugin.xml
  5. Copy & replace from line 58 with this `
    <framework src="com.google.firebase:firebase-messaging:17.+" />
    <framework src="com.google.firebase:firebase-config:16.+" />
    <framework src="com.google.firebase:firebase-perf:16.+" />`
  6. ionic cordova platform add android
  7. Goto directory platforms -> android -> build.gradle
  8. Change line 34 - from classpath 'com.google.gms:google-services:4.1.0' to classpath 'com.google.gms:google-services:4.2.0'

Run & Build again