I am trying to read xls and xlsx files. able to read xls but for xlsx getting Exception:-
java.lang.NoClassDefFoundError: Failed resolution of: Ljavax/xml/stream/XMLEventFactory;
at org.apache.poi.openxml4j.opc.internal.marshallers.PackagePropertiesMarshaller.<clinit>(PackagePropertiesMarshaller.java:45)
at org.apache.poi.openxml4j.opc.OPCPackage.init(OPCPackage.java:161)
at org.apache.poi.openxml4j.opc.OPCPackage.<init>(OPCPackage.java:141)
at org.apache.poi.openxml4j.opc.Package.<init>(Package.java:37)
at org.apache.poi.openxml4j.opc.ZipPackage.<init>(ZipPackage.java:87)
at org.apache.poi.openxml4j.opc.OPCPackage.open(OPCPackage.java:272)
at org.apache.poi.util.PackageHelper.open(PackageHelper.java:37)
at org.apache.poi.xssf.usermodel.XSSFWorkbook.<init>(XSSFWorkbook.java:258)
in "Workbook myWorkBook = new XSSFWorkbook(fileStream);" this line.
Apache POI jar files:-
poi-3.11-20141221.jar
poi-ooxml-3.11.jar
poi-ooxml-schemas-3.11.jar
poi-scratchpad-3.11-20141221.jar
xmlbeans-2.3.0.jar
also add
stax-api-1.0.1.jar
but not able to build this jar file in Android Studio.
i am not getting how to do this.
javax.xml
XML parsing library? – Gagravarr