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

标签 android cordova cordova-plugins

我收到此错误:

[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 并再次添加后,但返回相同的错误:

... 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 插件因为 google 服务与 firebase cordova-plugin-googleplus 冲突。

平台:

  • Cordova :8.1.2( Cordova 库:8.1.1)
  • Cordova -安卓:7.1.4

插件版本:

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

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

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

最佳答案

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

也许你可以检查一下。

关于android - 如何用 "play-services-measurement-base"调整 "cordova-android-play-services-gradle-release"的版本?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57794688/

相关文章:

android - GUI 在高 DPI 显示器上非常小

android - 关闭所有打开的 cordova 对话框

javascript - 用于 cordova 插件的 Typescript 到 Javascript

android - 无法为RecyclerView的DividerItemDecoration设置Custom Drawable

android - 如果您的应用程序具有设备管理员/设备所有者权限(未 Root ),如何杀死另一个应用程序

jquery - Dreamweaver CS5.5 中的 Phonegap

mobile - phonegap 1.3.0 白名单是什么状态?

android - Ionic 3 在 Android 中将 URL 读取为 base64

java - onConfigurationChanged 无法正常工作

android - 如何在 react-native 中添加破折号或虚线边框?