我收到此错误:
[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/