简体   繁体   English

我的Gradle正在检测多个appCompat版本

[英]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.026.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'

}

Option1 选项1

Find conflict dependency 查找冲突依赖性

Use command gradlew app:dependencies (in folder where gradlew in project), it will print you dependency tree. 使用命令gradlew app:dependencies (在gradlew在项目中的文件夹中),它将打印您的依赖树。

Exclude 排除

When you find some conflict dependency, then exclude 当您发现一些冲突依赖性时,请排除

compile ("com.someLibrary:1.0") {
    exclude group: 'com.android.support', module: 'appcompat-v7'
}

Option2 选项2

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.

相关问题 在 gradle 中添加 appcompat-v7 不会自动将我的布局视图切换到 AppCompat 版本 - Adding appcompat-v7 in gradle is not switching my layout views to AppCompat versions automatically 使用 Gradle 实现多个库版本 - Implement multiple library versions with Gradle Appcompat 和 Recyclerview 版本差异 - Appcompat and Recyclerview versions difference 如何添加同一个库 Gradle 的多个版本 - How to Add multiple versions of the same library Gradle 如何在 gradle 中添加 appcompat? - How to add appcompat in gradle? 为什么我在gradle中设置的appcompat v7版本22时,我的项目总是下载appcompat v7版本23? - Why my project always download appcompat v7 version 23 when i setting in gradle is appcompat v7 version 22? 我无法在Android的应用程序级别gradle文件中获取appcompat版本,这是我的代码 - Im unable to get the appcompat version in my app level gradle file in android this is my code 同步android gradle appcompat 27.0.1 - syncing android gradle appcompat 27.0.1 gradle期间appcompat版本错误 - Error in appcompat version during gradle 我的项目中有不同的Gradle版本? (gradle.xml与build.gradle) - Different Gradle versions in my project? (gradle.xml vs build.gradle)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM