android - android studio 中不兼容的 Gradle 版本
问题描述
我试图制作谷歌地图程序,它给出了那个错误
../../build.gradle: All com.android.support libraries must use the exact same version specification (mixing versions can lead to runtime crashes).
Found versions 28.0.0, 26.1.0. Examples include com.android.support:animated-vector-drawable:28.0.0 and com.android.support:support-media-compat:26.1.0
有一些库或工具和库的组合不兼容,或者可能导致错误。一种这样的不兼容性是使用不是最新版本的 Android 支持库版本(或者特别是低于您的 targetSdkVersion 的版本)进行编译。注意:此问题在 Android Studio 和 IntelliJ IDEA 中有关联的快速修复操作。要抑制此错误,请使用问题 ID“GradleCompatible”,如抑制警告和错误部分中所述。
版本
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
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'
implementation'com.google.android.gms:play-services-maps:16.0.0'
implementation 'com.google.android.gms:play-services-location:16.0.0'
}
解决方案
您需要从esspresso-corecom.android.support
中排除依赖项,如下所示:
androidTestImplementation('com.android.support.test.espresso:espresso-core:3.0.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
这将解决您的问题。
推荐阅读
- html - CSS选择组合多个选择器
- php - htacess 可以验证斜杠 url
- python - 我可以在 Django 的生产服务器上提供媒体文件吗?
- awk - 使用带有数组的 awk 命令将行转换为列
- html - Apache2 localhost 不断崩溃?
- vba - 运行隐形 Word 应用程序的宏
- swift - 在多个故事板场景中使用 Core Data 和 Cocoa 绑定
- java - 如何在现有应用程序中使用测试容器?
- c# - 我无法从 C# Windows 窗体应用程序中捕获 Microsoft Edge url
- java - 如何解决eclipse自动转换的问题;输入不需要的方法?