How to adjust the version of “play-services-measurement-base” with “cordova-android-play-services-gradle-release”?

淺唱寂寞╮ 提交于 2020-02-15 09:36:14

问题


I receive this error:

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

I install cordova-plugin-firebase plugin and read this instructions:

  • https://github.com/arnesson/cordova-plugin-firebase#google-play-services

Google Play Services Your build may fail if you are installing multiple plugins that use Google Play Services. This is caused by the

plugins installing different versions of the Google Play Services library. This can be resolved by installing cordova-android-play-services-gradle-release.

...

My config.xml:

<variable name="PLAY-SERVICES-MEASUREMENT" value="17.2.0" />
<variable name="PLAY-SERVICES-MEASUREMENT-API" value="17.2.0" />
<variable name="PLAY-SERVICES-MEASUREMENT-IMPL" value="17.2.0" />
<variable name="PLAY-SERVICES-MEASUREMENT-SDK" value="17.2.0" />
<variable name="PLAY-SERVICES-MEASUREMENT-SDK-API" value="17.2.0" />

After I removed platform android and add again, but returns same error:

... library com.google.android.gms:play-services-measurement-base is being requested by various other libraries at [[17.0.0,17.0.0], [17.2.0,17.2.0]]

I'm not sure, but maybe it's the cordova-plugin-googleplus plugin that conflicts with firebase cordova-plugin-googleplus because of google services.

Platforms:

  • cordova: 8.1.2 (cordova-lib: 8.1.1)
  • cordova-android: 7.1.4

Plugins versions:

  • cordova-plugin-firebase: 2.0.5
  • cordova-plugin-googleplus: 8.0.0
  • cordova-android-play-services-gradle-release: 4.0.0

I really don't want to be required to edit the platforms/android/project.properties file (as suggested in most SO answers), because any installation or reinstallation of plugins I would be required to edit again, and if someone else is going to work on the project this would also complicate.

Can you solve this with cordova-android-play-services-gradle-release plugin (or other means) and without editing the platforms/android/project.properties?


回答1:


I also had the same problem for days. I can not adjust the versions. Then today, when I look back to repo's issues page, I saw that some plugin named cordova-plugin-firebasex solves this and more issues.

Maybe you can check it out.



来源:https://stackoverflow.com/questions/57794688/how-to-adjust-the-version-of-play-services-measurement-base-with-cordova-andr

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!