java - 与依赖冲突:build.gradle
问题描述
我添加了一个新的依赖项
compile 'com.github.markomilos:paginate:0.5.1'
但是在同步构建之后,我有一个错误
“与依赖项 com.android.support:support-annotations' 冲突”
这是我的 build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
defaultConfig {
applicationId "com.formation.mvpnewproject"
minSdkVersion 17
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
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.code.gson:gson:2.8.1'
implementation 'com.squareup.okhttp3:logging-interceptor:3.9.1'
implementation 'com.squareup.retrofit2:retrofit:2.3.0'
implementation 'com.squareup.retrofit2:converter-gson:2.3.0'
implementation 'com.squareup.retrofit2:adapter-rxjava:2.3.0'
compile 'com.github.markomilos:paginate:0.5.1'
}
谢谢你。
解决方案
build.gradle(app)
将此作为顶级文件使用到您的文件中。
configurations.all {
resolutionStrategy.force 'com.android.support:support-annotations:23.0.1'
}
喜欢:
apply plugin: 'com.android.application'
android {
.......
.......
}
configurations.all {
resolutionStrategy.force 'com.android.support:support-annotations:23.0.1'
}
dependencies {
........
.......
}
推荐阅读
- parse-platform - 如果不存在,则解析模式添加字段
- numpy - 在 Keras 指标之间共享操作结果
- excel - 将工作表复制并粘贴到另一个工作簿,然后返回到您复制的工作簿
- python - 在 Mac 上使用 IDLE 安装 glob2
- swiftui - SwiftUI 在视图之间切换
- python - Python3 以编程方式将字符串转换为原始字符串
- python - 当有多个同名对象时更新 JSON - Python
- azure-devops - 如何找出:拉取请求是否涵盖给定分支中的所有提交?
- c# - 我可以在方法结束时安全地删除 await Task.CompletedTask 调用吗?
- c# - C# UWP 中的 TouchMajor 和 TouchMinor