Android-修复java.lang.RuntimeException: http://xml.org/sax/properties/declaration-handler

poi的文档读写功能

一开始用的这个

//    implementation rootProject.ext.newDependencies.poi
//    implementation rootProject.ext.newDependencies.poixml
//    implementation('javax.xml.stream:stax-api:1.0-2') 

读取的时候报错,java.lang.RuntimeException: http://xml.org/sax/properties/declaration-handler

但写入正常

于是找解决方案,找了很久,找到一个

   implementation group: 'org.apache.poi', name: 'poi-ooxml', version: '3.17'
   implementation group: 'org.apache.xmlbeans', name: 'xmlbeans', version: '3.1.0'
   implementation 'javax.xml.stream:stax-api:1.0'
   implementation 'com.fasterxml:aalto-xml:1.2.2'

写入、读取都正常

感谢
https://stackoverflow.com/questions/63210041/saxnotrecognizedexception-when-reading-excel-file-using-apache-poi

image.png

这位老哥

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容