我正在尝试构建一个我们同时使用 Google Analytics 和 Firebase 的 android react native 应用程序,我在编译时遇到了这个问题:
The library com.google.android.gms:play-services-measurement-base is being requested by various other libraries at [[16.0.0,16.0.0]], but resolves to 16.0.2. Disable the plugin and check your dependencies tree using ./gradlew :app:dependencies.
在分析我们的 gradle 扫描后(见下图),我们发现我们有一个模块需要 com.google.firebase:firebase-core
另一个需要 com.google.android.gms:play-services-analytics
.
这两个模块都需要 play-services-measurement-base
但由于这些模块是在不同的存储库中下载的(一个是 google,另一个是 maven)。我们注意到版本 16.0.2 仅在 google 存储库上发布,而不是在 maven 上发布(查看下面的图片)。
我们试图禁用依赖项检查,但没有成功。如果有人对此问题有解决方案或可以就此问题联系 google/maven。
google(), jcenter()
临时解决方案:明确排除
play-services-measurement-base
像这样来自 Firebase:
implementation("com.google.firebase:firebase-core:16.0.1") {
exclude group: 'com.google.android.gms', module: 'play-services-measurement-base'
}
或检查接受的答案。
最佳答案
您可以将分辨率强制为特定版本号:
configurations.all() {
resolutionStrategy.force "com.google.android.gms:play-services-measurement-base:16.0.2"
}
或
exclude
版本 16.0.0
来自冲突模块 com.google.firebase:firebase-core
.
关于android - google 和 maven 存储库之间的 play-services-measurement-base 版本不匹配,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52004016/