开始使用ConstraintLayout后出现双重错误

问题描述 投票:0回答:1

在开始使用约束布局后,我的应用程序无法构建。它显示了一个错误enter image description here当我分别实现每个库时,这个东西可能会修复。此错误FOR现在不显示但不编译现在这样的依赖项

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:multidex:1.0.3'
    implementation 'com.android.support:support-v4:27.1.0'
    implementation 'com.android.support:cardview-v7:27.1.0'
    implementation 'com.android.support:animated-vector-drawable:27.1.0'
    implementation 'com.android.support:customtabs:27.1.0'
    implementation 'com.android.support:appcompat-v7:27.1.0'
    implementation 'com.android.support:design:27.1.0'
    implementation 'com.android.support.constraint:constraint-layout:1.0.2'

我已经完成了Clean - > Rebuild我也尝试手动更改该错误的库但没有结果。在完成所有与手动工作的工作后,我收到了新的错误enter image description here

我的OLD VERSION gradle文件代码如下

    apply plugin: 'com.android.application'

android {
    compileSdkVersion 27
    defaultConfig {
        applicationId "com.borisruzanov.myapp"
        minSdkVersion 21
        targetSdkVersion 27
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        resConfigs "auto"
        // Enabling multidex support.
        multiDexEnabled true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}



dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:multidex:1.0.3'
    implementation 'com.android.support:support-v4:27.1.0'
    implementation 'com.android.support:appcompat-v7:27.1.0'
    implementation 'com.android.support:design:27.1.0'
    implementation 'com.android.support.constraint:constraint-layout:1.0.2'

    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.1'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'

    //General
    compile 'com.facebook.android:facebook-android-sdk:4.29.0'

    //Firebase
    compile 'com.google.firebase:firebase-core:11.8.0'
    compile 'com.google.firebase:firebase-database:11.8.0'
    compile 'com.google.firebase:firebase-auth:11.8.0'
    compile 'com.google.firebase:firebase-storage:11.8.0'
    implementation 'com.firebaseui:firebase-ui-auth:3.2.1'
    implementation 'com.firebaseui:firebase-ui-database:3.2.1'
    compile 'com.google.firebase:firebase-messaging:11.8.0'
    compile 'com.google.firebase:firebase-config:11.8.0'

    //Images
    implementation 'com.github.bumptech.glide:glide:4.6.1'
    annotationProcessor 'com.github.bumptech.glide:compiler:4.6.1'
    compile 'de.hdodenhof:circleimageview:2.2.0'
    compile 'com.theartofdev.edmodo:android-image-cropper:2.6.+'
    compile 'com.squareup.picasso:picasso:2.5.2'
    compile 'id.zelory:compressor:2.1.0'

    //Network
    compile 'com.squareup.okhttp:okhttp:2.7.5'

    compile 'com.android.support:cardview-v7:27.1.0'
}

apply plugin: 'com.google.gms.google-services'

想出Firebase使用支持库的不同版本。我怎么能改变它? enter image description here

android android-studio gradle android-gradle build.gradle
1个回答
0
投票

我从两天开始面对这个问题,现在我解决了这个问题,这些都是步骤

首先在您的应用级gradle文件中尝试此操作

implementation('com.github.bumptech.glide:glide:4.6.1') {
exclude group: 'com.android.support'
}`

如果它不解决try logging dependencies运行此命令

./gradlew -q dependencies app:dependencies --configuration compile

在你的android工作室的终端选项卡中,它将记录你项目的所有依赖树

然后找到哪些库正在使用重复的依赖项

例如

implementation 'com.github.bumptech.glide:glide:4.6.1' is using duplicate dependencies 

所以改变

implementation 'com.github.bumptech.glide:glide:4.6.1'

implementation('com.github.bumptech.glide:glide:4.6.1') {
exclude group: 'com.android.support'
 }

而已..

© www.soinside.com 2019 - 2024. All rights reserved.