XMLBeans复制类和未找到类错误 [英] XMLBeans Duplicate Class and Class Not Found Errors

查看:169
本文介绍了XMLBeans复制类和未找到类错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经尝试了好几天使Apache POI API正常工作,但是xmlbeans2.6.0 jar一直导致我遇到错误.首先,每当我尝试运行我的应用程序时,它都会崩溃,并说有一个重复的类,因此我执行了提取所有文件并将这些文件转换回jar的常规方法.但是,现在我得到了这个错误:

I have been trying for days to get the Apache POI API to work, but I keep running into errors with the xmlbeans2.6.0 jar. First, whenever I tried to run my app, it would crash saying that there was a duplicate class, so I did the usual method of extracting all the files and converting those files back into a jar; however, now I get that this error:

java.lang.ClassNotFoundException:

java.lang.ClassNotFoundException:

在路径:DexPathList [[zip文件"/data/app/arcane.com.athletesunited-1/base.apk"]中找不到类"org.apache.xmlbeans.XmlOptions"

Didn't find class "org.apache.xmlbeans.XmlOptions" on path: DexPathList[[zip file "/data/app/arcane.com.athletesunited-1/base.apk"]

有什么想法吗?

Jacob

推荐答案

Apache POI在Android上无法立即使用.使用基于XML的格式时,裸Apache Apache POI库会遇到一些问题,部分原因是Android有一些局限性,还因为XMLBeans jar文件具有重复的类文件.

Apache POI will not work out of the box on Android. With the XML based formats you will run into a few issues with bare Apache POI libraries, partly because Android has some limitations and also because the XMLBeans jar file has duplicate class files among others.

当前至少有两个项目包装/调整了Apache POI,以便在Android上更轻松地使用:

There are currently at least two projects that wrap/adjust Apache POI for easier usage on Android:

  1. https://github.com/andruhon/android5xlsx (适用于Android 5)和 https://github.com/andruhon/AndroidReadXLSX (适用于Android 4),都提供了Apache POI的预打包库,但目前两者仍基于Apache POI 3.12
  2. https://github.com/centic9/poi-on-android/(对于由我维护的Android 5),此方法使用了另一种方法,并允许使用Apache POI的较新版本更轻松地重新构建打包的库,例如当前使用3.15
  1. https://github.com/andruhon/android5xlsx (for Android 5) and https://github.com/andruhon/AndroidReadXLSX (for Android 4), both provide pre-packaged libraries of Apache POI, but both are currently still based on Apache POI 3.12
  2. https://github.com/centic9/poi-on-android/ (for Android 5, maintained by me), this one uses a different approach and allows to more easily re-build the packaged library with newer versions of Apache POI, e.g. it uses 3.15 currently

这篇关于XMLBeans复制类和未找到类错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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