Answer the question
In order to leave comments, you need to log in
Android - how to parse .xlsx (getting SAXNotRecognizedException)?
I'm trying to parse an excel file using apache.poi: An
error occurs:
Caused by: org.xml.sax.SAXNotRecognizedException: http://xml.org/sax/properties/declaration-handler
dependencies {
...
implementation 'javax.xml.stream:stax-api:1.0'
implementation 'org.apache.poi:poi:4.1.2'
implementation 'org.apache.poi:poi-ooxml:4.1.2'
implementation 'org.apache.poi:poi-ooxml-schemas:1.4'
var inputStream = assets.open("sample.xlsx")
val book = XSSFWorkbook(inputStream)
val sheet = book.getSheetAt(0)
Answer the question
In order to leave comments, you need to log in
The first thing to check is if the "sample.xlsx" file exists where your code is trying to open it from.
And the second: is this file valid, maybe you have it broken at all.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question