POI:重复项:组织/阿帕奇/的XMLBeans / XML /流/ Location.class [英] POI : duplicate entry: org/apache/xmlbeans/xml/stream/Location.class

查看:1018
本文介绍了POI:重复项:组织/阿帕奇/的XMLBeans / XML /流/ Location.class的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

的Andr​​oid POI整合。我已经做了很多的搜索,但没有找到解决办法。

Android POI integration. I have done lots of search but did not find solution.

Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'.
> com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: org/apache/xmlbeans/xml/stream/Location.class

我gradle这个

My gradle

compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'

compile 'com.google.code.gson:gson:2.4'
compile 'com.jakewharton:butterknife:7.0.1'
compile 'com.github.rey5137:material:1.2.2'
compile('com.github.afollestad.material-dialogs:core:0.8.5.4@aar') {
    transitive = true
}
compile('com.mikepenz:materialdrawer:5.0.0@aar') {
    transitive = true
}
compile 'com.pnikosis:materialish-progress:1.5'
compile 'org.apache.poi:poi-ooxml:3.13'

我发现这
https://github.com/sbt/sbt-proguard/issues/9

有没有解决在这里。

<一个href=\"http://stackoverflow.com/questions/26942297/xmlbeans-jar-cant-be-signed-when-imported-from-custom-class\">There没有办法了这里。

<一个href=\"http://stackoverflow.com/questions/34203143/android-studio-build-transformclasseswithjarmergingfordebug-error\">There没有办法了这里。

我没有使用任何其他的Apache库。而不是使用谷歌播放服务。还是同样的问题是存在的。

I did not used any other apache lib. and not used google play service. still the same issue is there.

推荐答案

有一个关于如何让POI在Android上工作,例如看到一些讨论的http://blog.kondratev.pro/2015/08/reading-xlsx-on-android-4-and-hopefully.html

There a some discussions about how to get POI working on Android, see e.g. http://blog.kondratev.pro/2015/08/reading-xlsx-on-android-4-and-hopefully.html

的打击特别指出

[...]但是它不会straighforwardly因为在行家XMLBeans的罐子是有缺陷的,并包含类的副本,[...]很容易只是prepare罐子一次工作,并把它们放到libs目录(如上述)

[...] however it will not work straighforwardly because xmlbeans jar in maven is defective and contains duplicates of classes, [...] it is easier just to prepare jars once and put them into libs directory (as described above)

所以,你可能需要做一些事情,使其工作,或者你可以在 HTTPS使用重新打包项目://github.com/andruhon/android5xlsx

So you might need to do a few things to make it work or you can use the re-packaged project at https://github.com/andruhon/android5xlsx

这篇关于POI:重复项:组织/阿帕奇/的XMLBeans / XML /流/ Location.class的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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