XMLBeans Duplicate Class 和 Class Not Found 错误 [英] XMLBeans Duplicate Class and Class Not Found Errors

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

问题描述

我几天来一直在尝试让 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:

在路径上没有找到类org.apache.xmlbeans.XmlOptions":DexPathList[[zip file/data/app/arcane.com.athletesunited-1/base.apk"]

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

有什么想法吗?

雅各

推荐答案

Apache POI 在 Android 上开箱即用.使用基于 XML 的格式时,您会遇到一些裸 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 Duplicate Class 和 Class Not Found 错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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