当前位置: 首页 > 知识库问答 >
问题:

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

酆浩邈
2023-03-14

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

  1. poi-ooxml-schemas-3.9-20121203.jar
  2. POI-OOXML-3.9-20121203.jar
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

有人能说出我在哪里失踪了吗?

共有1个答案

高勇
2023-03-14

如果你对任何android应用程序使用了太多的代码,编译就会抛出这个错误。本文对类似的问题进行了阐述和解决。您应该将应用程序分成几个部分,作为一个插件,以一个单独的APK的形式下载。该APK将公开主应用程序将使用的某些组件。在google play上有很多类似的应用程序。

 类似资料:
  • 我正在写一个程序,它需要从excel文件中读取和写入数据,而不考虑格式(xls或xlsx)。 我知道ApachePOI,但它似乎有不同的类来处理xls文件(HSSF)和xlsx(XSSF)文件。 任何人都知道我将如何实现我在这里的目标。(也欢迎使用POI以外的API的想法)。

  • 我是编程界的新手。嗯,我正在尝试使用ApachePOI库读取excel文件(5行5列)。我实际上有两个相同问题的实现。在第一个代码片段中,我只是读取excel文件并将其打印到控制台中。 然而,现在我正试图将读取的excel数据保存到一个数组中。所以我想在动态获取excel行和列大小后设置数组大小。但令我惊讶的是,当我执行第二个代码段时,似乎“while(cellIterator.hasNext()

  • 问题内容: 我有以下json文件。我想知道我应该将json文件放在我的项目中的位置以及如何读取和存储它。 问题答案: 将该文件放入资产中 。 对于在Android Studio项目中创建的项目,您需要在主文件夹下创建资产文件夹。 将该文件读取为: 然后您可以简单地通过此函数读取此返回 有关JSON的更多详细信息,请参见 http://www.vogella.com/articles/Android

  • 我有一个巨大的excel文件,其中包含大量列,如下所示:- 当我打印excel中的所有值时,我的代码生成的输出是:- 所以,如果我们看看上面的输出,我们可以注意到我留下空白值的单元格没有被POI库拾取。有没有一种方法可以让这些值为空?还是一种识别所呈现的值跳过空白单元格的方法? 请注意:我使用的不是usermodel(org.apache.poi.ss.usermodel),而是一个事件API来处

  • 我正在尝试用android显示PPT文件。我从ApachePOI开始,bcoz我还没有找到任何免费的开源jar。我从将ppt幻灯片转换为图像开始,参考此链接将PowerPoint幻灯片导出为java。awt。图表2D 这是Java语言。我找不到Dimension、BuffereImage和Graphics2D类。我已经导入了poi-scratchpad-3.8-20120326。jar在我的构建路

  • 问题内容: 我正在开发一个概念验证应用程序,以便可以在我正在开发的更大的应用程序中实现该功能。我对Java和Android Dev有点陌生,但希望这个问题不会太简单或太复杂。 基本上,我正在尝试从CSV文件中读取字符串列表,并使其可用于在应用程序的主活动中显示该列表。 我正在使用外部类来读取CSV文件。这是课程代码: CSVFile.java 这是我的主要活动代码: MainActivity.ja