在org官网下载的poi jar包,导入到studio

compile files('libs/poi-3.17.jar')

compile files('libs/poi-ooxml-3.17.jar')

compile files('libs/poi-ooxml-schemas-3.17.jar')

compile files('libs/xmlbeans-2.6.0.jar')

如果项目报

java.lang.NoClassDefFoundError: Failed resolution of: Ljavax/xml/stream/XMLEventFactory;
Caused by: java.lang.ClassNotFoundException: Didn't find class "javax.xml.stream.XMLEventFactory" on path: DexPathList[[zip file "/data/app/com.

可能是使用的jar包版本过高,我换成3.10的版本之后就好了。


再报异常

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

原因是最新的xmlbeans-2.6.0.jar中包含了重复的类文件,将jar包更换为稍低的版本就行了;

但是接着可能会报内存溢出异常,Error:java.lang.OutOfMemoryError: GC overhead limit exceeded

在Androidstudio的gradle中配置即可。

android {
...
dexOptions {
preDexLibraries false
incremental false
javaMaxHeapSize "3072m"
}
...
}

android studio 解析Excel数据格式导入poi-3.17.jar时的一系列报错及处理Failed resolution of: Ljavax/xml/stream/XMLEventFactory,duplicate entry: org/apache/xmlbeans/xml/stream/Location.class,GC overhead limit exceeded的更多相关文章

  1. android studio Error:java.lang.OutOfMemoryError: GC overhead limit exceeded

    android studio Error:java.lang.OutOfMemoryError: GC overhead limit exceeded 在app下的build.gradle中找到and ...

  2. Android:java.lang.OutOfMemoryError:GC overhead limit exceeded

    Android编译:java.lang.OutOfMemoryError:GC overhead limit exceeded 百度好多什么JVM啊之类的东西,新手简单粗暴的办法: 1.在的Model ...

  3. troubleshooting-sqoop mysql导入hive 报:GC overhead limit exceeded

    Halting due to Out Of Memory Error...18/09/13 21:42:17 INFO mapreduce.Job: Task Id : attempt_1536756 ...

  4. Maven依赖包导入错误(IntelliJ IDEA):java.lang.OutOfMemoryError: GC overhead limit exceeded

    一.问题背景 最近用IntelliJ IDEA 打开一个老应用,一直加载依赖不成功,主POM中存在如下错误. java.lang.OutOfMemoryError:GC overhead limit ...

  5. Unable to execute dex: GC overhead limit exceeded

    Android打包时下面的错误: Unable to execute dex: GC overhead limit exceeded GC overhead limit exceeded 解决的方法: ...

  6. eclipse一直报An internal error occurred during: "Building workspace". GC overhead limit exceeded

    最近导入到eclipse里的工程挺大的,每次eclipse启动之后都回update workspace,然后就一直报: An internal error occurred during: " ...

  7. 解决:Unable to execute dex: GC overhead limit exceeded

    转自http://blog.sina.com.cn/s/blog_6e334dc70101hnug.html Android打包时下面的错误: Unable to execute dex: GC ov ...

  8. Spark 1.4.1中Beeline使用的gc overhead limit exceeded

    最近使用SparkSQL做数据的打平操作,就是把多个表的数据经过关联操作导入到一个表中,这样数据查询的过程中就不需要在多个表中查询了,在数据量大的情况下,这样大大提高了查询效率.   我启动了thri ...

  9. java.lang.OutOfMemoryError:GC overhead limit exceeded填坑心得

    我遇到这样的问题,本地部署时抛出异常java.lang.OutOfMemoryError:GC overhead limit exceeded导致服务起不来,查看日志发现加载了太多资源到内存,本地的性 ...

随机推荐

  1. shell 知识点

        Q:1 Shell脚本是什么.它是必需的吗? 答:一个Shell脚本是一个文本文件,包含一个或多个命令.作为系统管理员,我们经常需要使用多个命令来完成一项任务,我们可以添加这些所有命令在一个文 ...

  2. 解决Maven->update project 恢复为默认jdk1.5以及One or more constraints have not been satisfied问题

    使用maven架构创建dynamic web 项目之后,默认指定的jdk 和compilerVersion都非常古老,而且即便你手动更新了版本之后,每次update project都会复位,非常不爽. ...

  3. JFACE-SWT开发记录

    需要的工具 1.Eclipse 2.JDK 3.exe4j 4.Eclipse附加插件windowsBuilder :百度直接搜去eclipse官网下 exe4j配置:http://xiejiangl ...

  4. Session的clear方法和flush方法

    Session Clear()与 Flush() 解释 1.Clear 方法  无论是Load 还是 Get 都会首先查找缓存(一级缓存) 如果没有,才会去数据库查找,调用Clear() 方法,可以强 ...

  5. 行为类模式(九):策略(Strategy)

    定义 针对一组算法,将每一个算法封装到具有共同接口的独立的类中,从而使得它们可以相互替换.策略模式使得算法可以在不影响到客户端的情况下发生变化. UML 优点 策略模式提供了管理相关的算法族的办法.策 ...

  6. qs文档翻译

    安装: npm install qs --save-dev 基本用法: let qs = require('qs'); let assert = require('assert'); //qs.par ...

  7. 远程mysql导入本地文件

    远程mysql导入本地文件 登陆数据库 mysql --local-infile -h<IP> -u<USR> -p 选择数据库 USE xxx 导入文件 LOAD DATA ...

  8. Unique constraint on single String column with GreenDao2

    转:http://software.techassistbox.com/unique-constraint-on-single-string-column-with-greendao_384521.h ...

  9. Eclipse报This version of the rendering library is more recent than your version of ADT ...

    http://blog.csdn.net/zhao_3546/article/details/12968295 最近使用 Help --> Check for Updates 升级了Eclips ...

  10. 【Python】TCP Socket的粘包和分包的处理

    Reference: http://blog.csdn.net/yannanxiu/article/details/52096465 概述 在进行TCP Socket开发时,都需要处理数据包粘包和分包 ...