如何调整"play-services-measurement-base"和"cordova-android-play-services-gradle-release"的版本?

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

我收到此错误:

[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.

我安装 cordova-plugin-firebase 插件并阅读此说明:

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.

...

我的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" />

我删除 platform android 并再次添加后,但 returns 同样的错误:

... 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]]

我不确定,但可能是 cordova-plugin-googleplus 插件与 firebase cordova-plugin-googleplus 冲突,因为 google 服务。

平台:

插件版本:


我真的不希望被要求编辑platforms/android/project.properties文件(正如大多数SO answers所建议的),因为任何安装或重新安装我将需要再次编辑插件的数量,如果其他人要处理该项目,这也会变得复杂。

你能用 cordova-android-play-services-gradle-release 插件(或其他方式)解决这个问题而不编辑 platforms/android/project.properties 吗?

我这几天也遇到了同样的问题。我无法调整版本。然后今天,当我回顾 repo 的问题页面时,我看到一些名为 cordova-plugin-firebasex 的插件解决了这个问题以及更多问题。

也许你可以去看看。