本文介绍了无法合并dex Android Studio错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是 build.gradle(Module:app)

apply plugin: 'com.android.application'
apply plugin: 'me.tatarka.retrolambda'

android {
    compileSdkVersion 23
    buildToolsVersion '23.0.3'

    defaultConfig {
        applicationId "com.demo.appdemo"
        minSdkVersion 15
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
        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
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile project(':libs:MaterialDrawer')
    compile project(':libs:EasyPreferences')
    compile project(':libs:PullToRefreshPheonix')
    compile('com.github.afollestad.material-dialogs:commons:0.8.5.4@aar') {
        transitive = true
    }
    compile 'me.leolin:ShortcutBadger:1.1.19@aar'

    implementation 'com.android.support:appcompat-v7:23.2.0'
    compile 'com.android.support:support-v13:23.2.0'
    compile 'com.android.support:design:23.2.0'
    compile 'com.jakewharton:butterknife:8.8.1'
    annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'

    compile 'com.github.dmytrodanylyk.circular-progress-button:library:1.1.3'
    compile 'com.wdullaer:materialdatetimepicker:2.2.0'
    compile 'com.github.jkwiecien:EasyImage:1.2.1'
    compile 'com.soundcloud.android:android-crop:1.0.1@aar'
    compile 'com.squareup.picasso:picasso:2.5.2'
    compile 'com.squareup.okhttp:okhttp:2.3.0'
    compile 'com.squareup.okio:okio:1.3.0'
    compile 'com.squareup.okhttp:logging-interceptor:2.6.0'
    compile 'commons-io:commons-io:2.0.1'
    compile 'com.github.castorflex.smoothprogressbar:library:1.1.0'
    compile 'com.github.castorflex.smoothprogressbar:library-circular:1.1.0'
    compile 'com.squareup.okhttp3:okhttp:3.1.2'
    compile 'com.squareup.retrofit2:retrofit:2.0.0-beta4'
    compile 'com.squareup.retrofit2:converter-gson:2.0.0-beta4'
    compile 'org.jdeferred:jdeferred-android-aar:1.2.4'
    compile 'com.squareup.okhttp3:logging-interceptor:3.0.1'
    compile 'org.greenrobot:eventbus:3.0.0'
    compile 'com.nononsenseapps:filepicker:2.5.2'
    compile 'com.miguelcatalan:materialsearchview:1.4.0'
    compile 'com.google.android.gms:play-services-gcm:8.4.0'
    compile 'com.android.support:support-v4:23.4.0'
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:recyclerview-v7:23.2.0'
    compile "com.daimajia.swipelayout:library:1.2.0@aar"
}
apply plugin: 'com.google.gms.google-services'

运行应用程序时出现以下错误:
运行应用程序时出现以下错误:
运行应用程序时出现以下错误出现:

When running the app the following error appears:When running the app the following error appears:When running the app the following error appears:

Error:Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.
> com.android.builder.dexing.DexArchiveMergerException: Unable to merge

我尝试了很多次但都失败了。请帮我!谢谢大家!
我尝试了很多次但都失败了。请帮我!谢谢大家!

I tried many times but failed. Please help me! Thank you everyone!I tried many times but failed. Please help me! Thank you everyone!

推荐答案

我看到您启用了multidex,但还没有完全启用。

I see you enabled multidex, but not completely.

android {
    defaultConfig {
       multiDexEnabled true
    }
}

dependencies {
  compile 'com.android.support:multidex:1.0.1'
}

也,如果您还没有这样做的话,请按照中的步骤进行操作将multidex添加到您的应用程序类和清单中。

Also, if you didn't do it already, follow the steps in the doc to add multidex to your application class and manifest.

这篇关于无法合并dex Android Studio错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-23 05:09
查看更多