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

后端 未结 21 1729
孤街浪徒
孤街浪徒 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:30

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

    and exact error which i was getting was below :

    Error:Execution failed for task 
    ':android:transformClassesWithJarMergingForDebug'.
    > com.android.build.api.transform.TransformException: 
    java.util.zip.ZipException: duplicate entry: 
    com/google/android/gms/internal/zzqx.class
    

    So first thing I search for class which causes "duplicate entry" error using ctrl+n in Android Studio and searched for com/google/android/gms/internal/zzqx.class and then it was showing 2 entries for gms class with one version 8.4.0 and 1 with version 11.6.0 .

    To fix it i made both to use 11.6.0 and it was fixed example

    earlier

        compile "com.google.android.gms:play-services-games:11.6.0"
        compile "com.google.android.gms:play-services-auth:8.4.0"
        compile "com.google.android.gms:play-services-ads:11.6.0"
    

    After

        compile "com.google.android.gms:play-services-games:11.6.0"
        compile "com.google.android.gms:play-services-auth:11.6.0"
        compile "com.google.android.gms:play-services-ads:11.6.0"
    

    Rebuilding Fixed .

提交回复
热议问题