【发布时间】:2018-06-21 10:29:26
【问题描述】:
在我尝试更新 sdk 版本(到 27)和 lib 版本之前,我的 build.gradle 一直很好。
在我的 build.gradle 中,我现在有:
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
implementation 'com.google.code.gson:gson:2.8.2'
implementation 'com.google.android.gms:play-services-ads:15.0.1'
implementation 'com.google.firebase:firebase-crash:16.0.1'
implementation 'com.google.firebase:firebase-core:16.0.1'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}
我收到一条错误消息:
Please fix the version conflict either by updating the version of the google-services plugin
(information about the latest version is available at https://bintray.com/android/android-tools/com.google.gms.google-services/) or updating the version of com.google.android.gms to 15.0.1.
.. 但你可以看到它是 15.0.1。
我在
下还有一条红色的下划线implementation 'com.android.support:appcompat-v7:27.1.1'
当我将鼠标悬停时,我得到:
all support libraries must use the exact same version ... found versions 27.1.1 and 26.1.0
但我没有看到任何 26.1.0。
我做错了什么?
【问题讨论】:
-
你能发布完整的 build.gradle 文件吗?
-
它通常指定具有版本的库的名称。一些依赖在内部使用的是旧版本,只需将提到的库版本为 26 并将其添加到版本 27
-
尝试使用 com.android.support 包下每个库中的相同版本
-
"但我没有看到任何 26.1.0" 那么您可能通过其他一些依赖项间接依赖它。您可以从命令行运行
gradlew app:dependencies来获取项目的依赖关系树。
标签: android gradle version conflicting-libraries