Gradle 同步失败 - play-services-measurement-base [英] Gradle sync fails - play-services-measurement-base
问题描述
我的 Android 项目有问题,我无法构建,这是我遇到的错误:
I have a problem on my Android project, I can't build, this is the error I have:
未能通知依赖解析侦听器.com.google.android.gms:play-services-measurement-base 库被 [[15.0.2,15.0.2], [15.0.4,15.0.4]] 的其他各种库请求,但解析为15.0.4.禁用插件并使用 ./gradlew :app:dependencies 检查你的依赖树.
Failed to notify dependency resolution listener. The library com.google.android.gms:play-services-measurement-base is being requested by various other libraries at [[15.0.2,15.0.2], [15.0.4,15.0.4]], but resolves to 15.0.4. Disable the plugin and check your dependencies tree using ./gradlew :app:dependencies.
我尝试了许多不同的解决方案,但问题仍然存在.我在项目根目录上的 gradle 文件上有正确的依赖项和存储库:
I tried many different solution I found but the problem persists. I have the right dependencies and repositories on gradle file on project root:
dependencies {
classpath 'com.android.tools.build:gradle:3.1.2'
classpath 'com.google.gms:google-services:4.0.1'
}
和
repositories {
jcenter()
mavenLocal()
mavenCentral()
maven {
url "https://maven.google.com"
}
}
在我的应用程序 gradle 上,我有以下依赖项:
On my app gradle I have the following dependencies:
implementation "com.google.android.gms:play-services-maps:15.0.1"
implementation "com.google.android.gms:play-services-places:15.0.1"
implementation "com.google.android.gms:play-services-gcm:15.0.1"
implementation "com.google.android.gms:play-services-location:15.0.1"
implementation "com.google.android.gms:play-services-analytics:15.0.2"
implementation "com.google.android.gms:play-services-auth:15.0.1"
implementation "com.google.android.gms:play-services-tagmanager:15.0.2"
implementation "com.google.firebase:firebase-core:16.0.0"
一些建议?
解决方案是更新以下依赖项:
The solution was update the following dependencies:
implementation "com.google.android.gms:play-services-analytics:16.0.0"
implementation "com.google.android.gms:play-services-tagmanager:16.0.0"
推荐答案
我遇到了同样的错误,升级 analytics
是关键:
I had the same exact error, upgrading analytics
was the key:
实现'com.google.android.gms:play-services-analytics:16.0.0'
我知道您认为所有内容都参考官方网站进行了更新,但是编写 15.0.0
并寻找建议效果更好.
I know you thought everything is updated referring to the official website, but writing 15.0.0
and looking for suggestions works better.
这篇关于Gradle 同步失败 - play-services-measurement-base的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!