如何解决java.util.zip.ZipException重复的条目:COM /谷歌/ GSON /注解/ Expose.class? [英] How to resolve java.util.zip.ZipException duplicate entry: com/google/gson/annotations/Expose.class?

查看:2845
本文介绍了如何解决java.util.zip.ZipException重复的条目:COM /谷歌/ GSON /注解/ Expose.class?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我采用了android工作室。在我的项目我正在试图编译以下两种库的。


  1. AWS.jar

  2. Mp_library.jar

两者都是.jar文件使用不同版本的GSON。
当我编译我的项目,我收到以下错误我

错误:执行失败的任务:cloudAndroid:packageAllDebugClassesForMultiDex


  

java.util.zip.ZipException:重复的条目:COM /谷歌/ GSON /注解/ Expose.class


  {相关性
编译文件树(导演:'库',包括:['的* .jar'])
    编译(名称:mp_library',分机:AAR)
编译文件(库/ AWS-Android的SDK核心-2.2.6.jar')
    编译文件(库/ AWS-Android的SDK-s3-2.2.6.jar')
}

你们能帮帮我。非常感谢。



解决方案

使用这条线在你的build.gradle文件

  defaultConfig {
  multiDexEnabled =真
}

I am using android studio. In my project i am try to compile two library's.

  1. AWS.jar
  2. Mp_library.jar

Both are .Jar files are using different GSON versions. When i compile my project i am getting below error

Error:Execution failed for task ':cloudAndroid:packageAllDebugClassesForMultiDex'.

java.util.zip.ZipException: duplicate entry: com/google/gson/annotations/Expose.class

    dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
    compile(name: 'mp_library', ext: 'aar')
compile files('libs/aws-android-sdk-core-2.2.6.jar')
    compile files('libs/aws-android-sdk-s3-2.2.6.jar')
}

Can you guys please help me. Thanks a lot.


解决方案

use this line in your build.gradle file

defaultConfig {
  multiDexEnabled = true    
}

这篇关于如何解决java.util.zip.ZipException重复的条目:COM /谷歌/ GSON /注解/ Expose.class?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆