java.util.zip.ZipException: duplicate entry during packageAllDebugClassesForMultiDex

后端 未结 21 1301
孤街浪徒
孤街浪徒 2020-11-22 07:37

I am not sure what this error means.

Execution failed for task \':excelSior:packageAllDebugClassesForMultiDex\'.
> java.util.zip.ZipException: duplicate          


        
21条回答
  •  粉色の甜心
    2020-11-22 08:18

    In my case the mentioned "duplicate entry" error arised after settingmultiDexEnable=true in the build.gradle.

    In order to fully resolve the error first of all have a look at Configure Apps with Over 64K Methods (espescially "Configuring Your App for Multidex with Gradle").

    Furthermore search for occurences of the class that causes the "duplicate entry" error using ctrl+n in Android Studio. Determine the module and dependency that contains the duplicate and exclude it from build, e.g.:

    compile ('org.roboguice:roboguice:2.0') {
        exclude module: 'support-v4'
    }
    

    I had to try multiple module labels till it worked. Excluding "support-v4" solves issues related to "java.util.zip.ZipException: duplicate entry: android/support/v4/*"

提交回复
热议问题