错误:任务':app:transformDexArchiveWithExternalLibsDexMergerForDebug'的执行失败。无法合并dex

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

gradle:2.3.3切换到gradle:3.0.1后,我遇到了dex合并的问题。

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

这是我的傻瓜。

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile 'com.android.support:appcompat-v7:25.4.0'
    compile 'com.android.support:support-v4:25.4.0'
    compile 'com.android.support:design:25.4.0'
    compile 'com.google.android.gms:play-services-maps:11.6.0'

    //    Retrofit
    compile 'com.squareup.retrofit2:retrofit:2.3.0'
    compile 'com.squareup.retrofit2:converter-gson:2.2.0'
    compile 'com.squareup.retrofit2:adapter-rxjava:2.0.2'
    compile 'com.squareup.okhttp:okhttp:2.5.0'
    compile 'com.squareup.okhttp:okhttp-urlconnection:2.0.0'
    compile 'com.squareup.okhttp3:logging-interceptor:3.6.0'
    //    RX
    compile 'com.netflix.rxjava:rxjava-android:0.16.1'

    //Butterknife
    compile 'com.jakewharton:butterknife:8.8.1'
    annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
}

有谁知道为什么我应该得到这个错误。

android gradle dex
1个回答
0
投票

检查外部库的app \ libs。

清洁项目重建项目

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