如何解决java.util.zip.ZipException重复的条目:COM /谷歌/ GSON /注解/ Expose.class? [英] How to resolve java.util.zip.ZipException duplicate entry: com/google/gson/annotations/Expose.class?
问题描述
我采用了android工作室。在我的项目我正在试图编译以下两种库的。
- AWS.jar
- 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.
- AWS.jar
- 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屋!