作者HelloJimmy (揪~~竟,能不能考上?)
看板AndroidDev
标题[问题] AS编译出现java.util.zip.ZipException
时间Wed Jun 29 21:55:42 2016
大家好,
自从eclipse移转到android studio後就从没编译成功过
不断出现java.util.zip.ZipException的错误
如:
Error:Execution failed for task
':app:transformClassesWithJarMergingForRelease'.
> com.android.build.api.transform.TransformException:
java.util.zip.ZipException: duplicate entry:
org/apache/http/ConnectionClosedException.class
我的dependencies:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.google.android.gms:play-services-location:9.0.2'
compile 'com.android.support:multidex:1.0.1'
compile 'com.android.support:support-v4:23.0.0'
compile 'com.android.support:appcompat-v7:23.0.0'
compile
'org.jbundle.util.osgi.wrapped:org.jbundle.util.osgi.wrapped.org.apache.http.client:4.1.2'
compile 'org.apache.httpcomponents:httpcore:4.4.5'
compile 'org.apache.httpcomponents:httpmime:4.5.2'
}
要如何找出重复的档案? 位置在哪? 如何处置重复的档案?
烦恼已久
谢谢大家!
--
※ 发信站: 批踢踢实业坊(ptt.cc), 来自: 36.225.108.56
※ 文章网址: https://webptt.com/cn.aspx?n=bbs/AndroidDev/M.1467208544.A.725.html
1F:→ ssccg: org/apache/http/ConnectionClosedException.class 06/30 00:34
2F:→ ssccg: ↑重复的,就不要放有重复class的jar档/dependency 06/30 00:37
3F:→ HelloJimmy: 可是我需要import不同namespace否则报错 但偏偏不同 06/30 21:18
4F:→ HelloJimmy: jar档有重复的class,如何处理? 06/30 21:19
5F:→ y3k: 我记得可以针对指定的dependency去exclude某个class 07/01 07:09
6F:→ ssccg: exclude是最後手段了,有适当dependency管理的library是不 07/01 09:26
7F:→ ssccg: 该有同一个class在两个jar档,除了light版跟完整版这种以外 07/01 09:27
8F:→ ssccg: apache httpmime就已经有depend httpclient > httpcore 07/01 09:33