POI:重复条目:org/apache/xmlbeans/xml/stream/Location.class [英] POI : duplicate entry: org/apache/xmlbeans/xml/stream/Location.class
问题描述
Android 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
我的毕业证
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
我没有使用任何其他 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
打击特别说明
[...] 但是它不会直接工作,因为 maven 中的 xmlbeans jar 有缺陷并且包含类的重复项,[...] 只准备一次 jars 并将它们放入 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:重复条目:org/apache/xmlbeans/xml/stream/Location.class的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!