0

I am new to using cordova and struggling with an issue during the 'cordova build android' process. Every time I try to do so I encounter the following error:

The library com.google.android.gms:play-services-measurement-base is >being requested by various other libraries at [[15.0.2,15.0.2]], but >resolves to 15.0.4.

Based on a search the recommended fix is to update all the firebase and google play libraries but being new to this I am unsure of how to do this. Could someone elaborate on how to do this or provide a link to a documentation that does?

Thank you.

I have already tried:

  • Removing the android platform and adding it again

  • Updating all the cordova plugins

  • Analyzing the dependencies in Android studio

  • Inserting the following line of code to the bottom of my build.gradle file.

com.google.gms.googleservices.GoogleServicesPlugin.config.disableVersionCheck = true
ams-digital
  • 35
  • 1
  • 3
  • Look at the build.gradle Files where the play-services and so on are imported. There you can resolve. Also don't forget to update cordova plugins and your framework from time to time. – Stefan Sprenger Apr 10 '19 at 06:58
  • Thank you for the response but the settings in config.xml override the build.gradle files whenever I try to rebuild. Updating cordova to v 9.0.0 results in other issues so I am trying to avoid doing so. – ams-digital Apr 10 '19 at 09:03
  • You can only override config.xml or update cordova for a lasting solution. All other solutions are not good and bring problems. You could also specify in the cordova plugins build.gradle files a lower version and give it a try. – Stefan Sprenger Apr 10 '19 at 14:52
  • I understand, unfortunately the project was started by someone else so I am stuck with trying to fix the legacy code. I plan to overhaul the framework in the coming future but it's not possible immediately. Thank you for the help regardless. – ams-digital Apr 11 '19 at 12:57
  • No problem. You could also try "Capacitor" instead of Cordova in the future. https://capacitor.ionicframework.com/docs/ Atm it is in beta, but it will be the next big thing in mobile emulation and leaves you with real android studio projects instead of stupid plugin files. Hopefully they will finish this project soon ;) – Stefan Sprenger Apr 11 '19 at 13:40
  • 1
    Ok thank you, I will take a look at that project so we can stop using Cordova. In case anyone ever finds this post in the future I was able to solve my issues by going directly into the build.gradle files in the /app folder and disabling version checking so I was able to build. Not ideal but at least it works. I also had to change my config.xml minSdkVersion from 16 to 19. – ams-digital Apr 12 '19 at 10:10

0 Answers0