POI : duplicate entry: org/apache/xmlbeans/xml/stream/Location.class

点点圈 提交于 2019-12-10 20:49:33

问题


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

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'

I found this https://github.com/sbt/sbt-proguard/issues/9

There is no solution here.

There is no solution here.

There is no solution here.

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


回答1:


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

The blow specifically states

[...] 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)

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



来源:https://stackoverflow.com/questions/35499583/poi-duplicate-entry-org-apache-xmlbeans-xml-stream-location-class

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!