1
votes

I have a problem regarding Excel(.xlsx) file import in Android SQLite database, I am using Poi jar file but finding following Runtime error.

  • java.lang.VerifyError: org/apache/poi/xssf/usermodel/XSSFWorkbook

How can i resolve this problem ? please help me.

2
Can you share your code Vikas ? - selva
@selva this is line where i m getting mentioned exception... XSSFWorkbook workbook = new XSSFWorkbook(input); where 'input' FileinputStream class object - Vikas

2 Answers

1
votes

If you are using maven try the following

<!-- http://mvnrepository.com/artifact/org.apache.poi/poi-ooxml -->
<dependency>
    <groupId>org.apache.poi</groupId>
    <artifactId>poi-ooxml</artifactId>
    <version>3.14</version>
</dependency>

if not just download the jar file and add in your built path.

0
votes

Java on Android has some intricacies which require some more work due to duplicate classes in some jars, the number of methods that POI has and some javax.* code that is included via transitive dependencies.

There are multiple approaches that were used by others over time:

Please try to use one of those and report back if you succeed. The first one is a rather new approach, but it would allow to re-package newer versions of Apache POI rather quickly compared to the other two which are a few versions behind already.