0

I want to create a xslx-File in my Android Application. Im Using Apache poi-ooxml-3.12.jar for it. But while calling the XSSFWorkbook Constructor I get the following exception:

FATAL EXCEPTION: main 
java.lang.VerifyError: org/apache/poi/xssf/usermodel/XSSFWorkbook

This is my Code:

Workbook workbook;

    if (StringOperationsUtil.getFileExtension(file).equalsIgnoreCase("XLSX")){
        workbook = new XSSFWorkbook();
    } else  { 
        //default xls
        workbook = new HSSFWorkbook();
    }

There is another Question about the topic out there (How to create .docx files and .xlsx files on Android) but there is no correct for me solution in it. Also the apache team didn't answer me. I can't believe that it's not possible to create the newest excel file in an android application. Does really any Android Developer is not using xlsx files? I really can't believe this. I'm using Android Studio btw.

Please let me know, if you guys know something about that issue.

Thanks in advance!

Community
  • 1
  • 1
pebbles
  • 356
  • 1
  • 3
  • 19
  • A previous question might help you http://stackoverflow.com/questions/30272103/how-to-resolve-the-java-lang-verifyerror-org-apache-poi-xssf-usermodel-xssfwork – AurA Jul 23 '15 at 12:09
  • Nope didnt. I already tried that out. This may be work in Eclipse but not in Android Studio.... :/ – pebbles Jul 23 '15 at 14:47

1 Answers1

1

The problem is incompatibility between the poi-ooxml .jar files and your Android OS.

I would definitely revisit this link first, carefully double-checking everything discussed:

How to resolve the java.lang.VerifyError: org/apache/poi/xssf/usermodel/XSSFWorkbook?

If that doesn't work, your "Plan B" might be dx:

Android java.lang.VerifyError?

Finally, it might even be an issue with ADT (although this link was for Eclipse, and you're using Android Studio):

Java.lang.verifyerror how do I fix or even find out the root cause?

Community
  • 1
  • 1
paulsm4
  • 114,292
  • 17
  • 138
  • 190