POI:重复条目:org / apache / xmlbeans / xml / stream / Location.class

时间:2016-02-19 07:21:11

标签: android apache-poi

Android POI集成。我做了很多搜索,但没有找到解决方案。

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

There is no solution here.

There is no solution here.

There is no solution here.

我没有使用任何其他apache lib。并没有使用谷歌播放服务。还有同样的问题。

1 个答案:

答案 0 :(得分:1)

有关如何让POI在Android上运行的一些讨论,请参阅例如http://blog.kondratev.pro/2015/08/reading-xlsx-on-android-4-and-hopefully.html

这一打击特别指出

  

[...]然而它不会直接工作,因为maven中的xmlbeans jar有缺陷并且包含类的副本,[...]更容易准备一次jar并将它们放入libs目录中(如上所述) )

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