首页 > 解决方案 > 无法制作或构建项目:任务“:app:transformDexArchiveWithExternalLibsDexMergerForDebug”执行失败

问题描述

一切正常。在我的应用程序中,我使用 Picasso 显示图像,默认情况下 Picasso 将图像旋转 90 度。我想用 Glide 代替,我尝试在项目中包含 Glide。从那以后,即使我从项目中删除了 Glide,我也收到了这个错误,但我无法再构建我的项目了。这是我的 Gradle。

项目.gradle

buildscript {
repositories {
    google()
    maven {
        url "https://maven.google.com"
    }
    maven {
        url 'https://maven.fabric.io/public'
    }
    jcenter()
}
dependencies {

    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
    classpath 'com.android.tools.build:gradle:3.4.2'
    classpath 'com.google.gms:google-services:4.2.0'
    classpath 'io.fabric.tools:gradle:1.31.0'
}

}

allprojects {
repositories {
    google()
    maven { url "https://maven.google.com" }
    maven { url "https://jitpack.io" }
    jcenter()
}


}


task clean(type: Delete) {
    delete rootProject.buildDir
}

应用程序.gradle

apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
apply plugin: 'io.fabric'

android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "xxx"
        minSdkVersion 21
        targetSdkVersion 28
        versionCode 40
        versionName "0.0.97"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        multiDexEnabled true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

    compileOptions
            {
                sourceCompatibility JavaVersion.VERSION_1_8
                targetCompatibility JavaVersion.VERSION_1_8
            }
    dexOptions {
        javaMaxHeapSize "8g"
    }
    useLibrary 'org.apache.http.legacy'
}

repositories {
    maven { url "https://jitpack.io" }

}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'androidx.appcompat:appcompat:1.0.2'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    implementation 'androidx.legacy:legacy-support-v4:1.0.0'
    implementation 'com.google.firebase:firebase-messaging:19.0.1'
    implementation 'com.google.firebase:firebase-inappmessaging-display:18.0.1'
    implementation 'com.google.firebase:firebase-dynamic-links:18.0.0'
    implementation 'com.mcxiaoke.volley:library:1.0.19'
    implementation 'gun0912.ted:tedpermission:2.2.2'
    implementation 'com.google.android.material:material:1.0.0'
    implementation 'com.github.BlacKCaT27:CurrencyEditText:2.0.2'
    implementation 'com.github.CardinalNow:Android-CircleProgressIndicator:v0.2'
    implementation 'com.txusballesteros:FitChart:1.0'
    implementation 'androidx.multidex:multidex:2.0.1'
    implementation 'com.google.code.gson:gson:2.8.5'
    implementation 'com.google.firebase:firebase-core:17.0.1'
    implementation 'com.crashlytics.sdk.android:crashlytics:2.10.1'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test:runner:1.2.0'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
}

请帮忙。

标签: androidgradlepicassoandroid-glide

解决方案


尝试添加这两个依赖项并告诉我,

implementation "android.arch.core:runtime:1.1.0"
implementation "android.arch.core:common:1.1.0"

推荐阅读