[英]My Gradle is detecting multiple appCompat versions
I've updated compileSDK to 28
and with it I've updated all of my dependencies to version 28.0.0
. 我已将compileSDK更新为
28
,并已将所有依赖项更新为28.0.0
版。 But I have problem with implementation 'com.android.support:appcompat-v7:28.0.0'
. 但是我对
implementation 'com.android.support:appcompat-v7:28.0.0'
有问题。 It says that I have two versions of this library, 28.0.0
and 26.1.0
. 它说我有这个库的两个版本,
28.0.0
和26.1.0
。 I've commented out my custom libraries one by one and after build it still says that I have two versions. 我已经逐一注释掉了我的自定义库,构建后仍然说我有两个版本。
How to fix this problem? 如何解决这个问题?
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.appID"
minSdkVersion 22
targetSdkVersion 28
versionCode 2
versionName "0.8.2"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
debuggable false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
repositories {
mavenCentral()
google()
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:recyclerview-v7:28.0.0'
implementation 'com.android.support:cardview-v7:28.0.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 "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
//glide
implementation 'com.github.bumptech.glide:glide:4.7.1'
annotationProcessor 'com.github.bumptech.glide:compiler:4.7.1'
//keyboardVisibilityPlugin
implementation 'net.yslibrary.keyboardvisibilityevent:keyboardvisibilityevent:2.1.0'
//swipeRevealLayout
implementation 'com.chauthai.swipereveallayout:swipe-reveal-layout:1.4.1'
//GoogleMaps
implementation 'com.google.android.gms:play-services-maps:16.0.0'
}
Use command gradlew app:dependencies
(in folder where gradlew
in project), it will print you dependency tree. 使用命令
gradlew app:dependencies
(在gradlew
在项目中的文件夹中),它将打印您的依赖树。
When you find some conflict dependency, then exclude 当您发现一些冲突依赖性时,请排除
compile ("com.someLibrary:1.0") {
exclude group: 'com.android.support', module: 'appcompat-v7'
}
You can just exclude from all without checking conflict library.. 您可以不检查冲突库就将其排除在外。
configurations {
all*.exclude group: 'com.android.support', module: 'appcompat-v7'
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.