android - 使用 Apache POI 在 Android 中读取 MS Excel 2010 文件

标签 android excel apache-poi

我正在使用 Apache POI在我的 android 应用程序中读取存储在 SDCARD 中的 xlsx 文件。 我正在使用来自 Apache POI 的以下 jar 库

  1. poi-ooxml-schemas-3.9-20121203.jar
  2. poi-ooxml-3.9-20121203.jar

但是当我尝试运行 Android 应用程序时,我得到下面提到的堆栈跟踪。

trouble writing output: Too many methods: 66024; max is 65536. By package:
    13 java.lang
     1 java.lang.reflect
     5 java.util
     1 javax.xml.namespace
    66 org.apache.xmlbeans
    19 org.apache.xmlbeans.impl.values
     1 org.apache.xmlbeans.impl.xb.xmlschema
  2500 org.openxmlformats.schemas.drawingml.x2006.chart
  1430 org.openxmlformats.schemas.drawingml.x2006.chart.impl
  8767 org.openxmlformats.schemas.drawingml.x2006.main
  5258 org.openxmlformats.schemas.drawingml.x2006.main.impl
    86 org.openxmlformats.schemas.drawingml.x2006.picture
    33 org.openxmlformats.schemas.drawingml.x2006.picture.impl
   745 org.openxmlformats.schemas.drawingml.x2006.spreadsheetDrawing
   417 org.openxmlformats.schemas.drawingml.x2006.spreadsheetDrawing.impl
   230 org.openxmlformats.schemas.drawingml.x2006.wordprocessingDrawing
   164 org.openxmlformats.schemas.drawingml.x2006.wordprocessingDrawing.impl
   298 org.openxmlformats.schemas.officeDocument.x2006.customProperties
   256 org.openxmlformats.schemas.officeDocument.x2006.customProperties.impl
   617 org.openxmlformats.schemas.officeDocument.x2006.docPropsVTypes
   596 org.openxmlformats.schemas.officeDocument.x2006.docPropsVTypes.impl
   285 org.openxmlformats.schemas.officeDocument.x2006.extendedProperties
   196 org.openxmlformats.schemas.officeDocument.x2006.extendedProperties.impl
    23 org.openxmlformats.schemas.officeDocument.x2006.math
    24 org.openxmlformats.schemas.officeDocument.x2006.relationships
     2 org.openxmlformats.schemas.officeDocument.x2006.relationships.impl
  2076 org.openxmlformats.schemas.presentationml.x2006.main
  1224 org.openxmlformats.schemas.presentationml.x2006.main.impl
     1 org.openxmlformats.schemas.schemaLibrary.x2006.main
  7271 org.openxmlformats.schemas.spreadsheetml.x2006.main
  4556 org.openxmlformats.schemas.spreadsheetml.x2006.main.impl
 11448 org.openxmlformats.schemas.wordprocessingml.x2006.main
  9217 org.openxmlformats.schemas.wordprocessingml.x2006.main.impl
     4 schemaorg_apache_xmlbeans.system.sE130CAA0A01A7CDE5A2B4FEB8B311707
  1170 schemasMicrosoftComOfficeExcel
  1223 schemasMicrosoftComOfficeExcel.impl
   285 schemasMicrosoftComOfficeOffice
   124 schemasMicrosoftComOfficeOffice.impl
     2 schemasMicrosoftComOfficePowerpoint
     3 schemasMicrosoftComOfficeWord
  2858 schemasMicrosoftComVml
  2529 schemasMicrosoftComVml.impl
[2013-11-25 21:20:32 - CRD] Conversion to Dalvik format failed with error 2

谁能告诉我哪里漏了?

最佳答案

如果您为任何 Android 应用程序使用过多代码,编译将抛出此错误。类似问题已说明并解决here .您应该将应用程序分成几个部分作为插件,以单独的 APK 形式可供下载。该 APK 将公开主应用程序将使用的一些组件。 google play 上有各种此类应用。

关于android - 使用 Apache POI 在 Android 中读取 MS Excel 2010 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20224083/

相关文章:

android - SwitchPreference振动

vba - 混淆 dd/mm/yyyy 和 mm/dd/yyyy

Excel VBA - 声明变量的不同方法

java - Apache POI A3 页面在打印预览中显示两页

Android - 相当于 UITableViewCell?

java - Android 动态 Mqtt 主题未从代理接收消息

android - setTextAppearance() 中的 TextView android-maps-utils 0.4.4 始终透明

vba - 自动适应列表框列宽

java - 如何在java中读取受密码保护的.xls文件?

java - POI SAX 日期数据类型