NoClassDefFoundError: org.apache.poi.javax.xml.stream.FactoryFinder
See original GitHub issueHi,
I’m facing the above issue even after adding the System properties as shown in ReadMe file.
Below is the log:
java.lang.RuntimeException: An error occurred while executing doInBackground() at android.os.AsyncTask$3.done(AsyncTask.java:309) at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:354) at java.util.concurrent.FutureTask.setException(FutureTask.java:223) at java.util.concurrent.FutureTask.run(FutureTask.java:242) at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:234) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588) at java.lang.Thread.run(Thread.java:818) Caused by: java.lang.NoClassDefFoundError: org.apache.poi.javax.xml.stream.FactoryFinder at org.apache.poi.javax.xml.stream.b.a(FactoryFinder.java:1) at org.apache.poi.javax.xml.stream.b.a(FactoryFinder.java:7) at org.apache.poi.javax.xml.stream.b.a(FactoryFinder.java:13) at org.apache.poi.javax.xml.stream.d.a(XMLEventFactory.java:1) at org.apache.poi.i.a.n.j.b.<clinit>(PackagePropertiesMarshaller.java:1) at org.apache.poi.i.a.a.v(OPCPackage.java:5) at org.apache.poi.i.a.a.<init>(OPCPackage.java:3) at org.apache.poi.i.a.l.<init>(ZipPackage.java:5) at org.apache.poi.i.a.a.a(OPCPackage.java:1) at org.apache.poi.util.l.a(PackageHelper.java:1) at org.apache.poi.l.b.l.<init>(XWPFDocument.java:1)
Target SDK Version is 29.
Its working in Debug APK. But not working in Release APK
Issue Analytics
- State:
- Created 3 years ago
- Reactions:3
- Comments:10 (3 by maintainers)
Top GitHub Comments
ok got it working please add this lines to proguard rules
-keep public class com.fasterxml**{;} -keep class org.apache**{;} -keep class org.codehaus**{;} -keep class org.etsi**{;} -keep class org.openxmlformats**{;} -keep class schemaorg_apache_xmlbeans**{;}
That’s because you have pro guard turned on in release build type, you should keep the crashed class in your progaurd. for example for this you can use: -keep class org.apache.poi.javax.xml.stream.FactoryFinder{*;}
I had the same problem and after keeping, another crash pops up which needs another keep in progaurd, so what I did is just keep all the library’s classes. you can do the same too.