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

时间:2017-11-20 21:12:58

标签: android gradle dex

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'
}

有没有人知道为什么我会收到这个错误。

1 个答案:

答案 0 :(得分:0)

检查外部库的app \ libs。

清理项目 重建项目

相关问题