centic9 / poi-on-android

A sample project that shows how Apache POI can be used in an Android application
Apache License 2.0
357 stars 89 forks source link

java.lang.IncompatibleClassChangeError: Class 'org.apache.xmlbeans.impl.store.Saver$DocSaveCur' does not implement interface 'java.util.List' in call to 'int java.util.List.size()' (declaration of 'org.apache.xmlbeans.impl.store.Saver' appears in base.apk!classes4.dex) #88

Closed dinhvuhaui closed 2 years ago

dinhvuhaui commented 3 years ago

Please help me.

03-04 19:39:10.393 10264  9448 10024 E AndroidRuntime: java.lang.IncompatibleClassChangeError: Class 'org.apache.xmlbeans.impl.store.Saver$DocSaveCur' does not implement interface 'java.util.List' in call to 'int java.util.List.size()' (declaration of 'org.apache.xmlbeans.impl.store.Saver' appears in base.apk!classes4.dex)03-04 19:39:10.393 10264  9448 10024 E AndroidRuntime:
    at org.apache.xmlbeans.impl.store.Saver.pushMappings(Saver.java:546)03-04 19:39:10.393 10264  9448 10024 E AndroidRuntime:
    at org.apache.xmlbeans.impl.store.Saver.processElement(Saver.java:406)03-04 19:39:10.393 10264  9448 10024 E AndroidRuntime:
    at org.apache.xmlbeans.impl.store.Saver.process(Saver.java:307)03-04 19:39:10.393 10264  9448 10024 E AndroidRuntime:
    at org.apache.xmlbeans.impl.store.Saver.<init>(Saver.java:123)03-04 19:39:10.393 10264  9448 10024 E AndroidRuntime:
    at org.apache.xmlbeans.impl.store.Saver$TextSaver.<init>(Saver.java:916)03-04 19:39:10.393 10264  9448 10024 E AndroidRuntime:
    at org.apache.xmlbeans.impl.store.Cursor._xmlText(Cursor.java:546)03-04 19:39:10.393 10264  9448 10024 E AndroidRuntime:
    at org.apache.xmlbeans.impl.store.Cursor.xmlText(Cursor.java:2436)03-04 19:39:10.393 10264  9448 10024 E AndroidRuntime:
    at org.apache.xmlbeans.impl.values.XmlObjectBase.xmlText(XmlObjectBase.java:1500)03-04 19:39:10.393 10264  9448 10024 E AndroidRuntime:
    at org.apache.xmlbeans.impl.values.XmlObjectBase.toString(XmlObjectBase.java:1485)03-04 19:39:10.393 10264  9448 10024 E AndroidRuntime:
    at org.apache.poi.POIXMLProperties.commit(POIXMLProperties.java:211)03-04 19:39:10.393 10264  9448 10024 E AndroidRuntime:
    at org.apache.poi.POIXMLDocument.write(POIXMLDocument.java:225) | 03-04 19:39:10.393 10264  9448 10024 E AndroidRuntime: java.lang.IncompatibleClassChangeError: Class 'org.apache.xmlbeans.impl.store.Saver$DocSaveCur' does not implement interface 'java.util.List' in call to 'int java.util.List.size()' (declaration of 'org.apache.xmlbeans.impl.store.Saver' appears in base.apk!classes4.dex)03-04 19:39:10.393 10264  9448 10024 E AndroidRuntime:
    at org.apache.xmlbeans.impl.store.Saver.pushMappings(Saver.java:546)03-04 19:39:10.393 10264  9448 10024 E AndroidRuntime:
    at org.apache.xmlbeans.impl.store.Saver.processElement(Saver.java:406)03-04 19:39:10.393 10264  9448 10024 E AndroidRuntime:
    at org.apache.xmlbeans.impl.store.Saver.process(Saver.java:307)03-04 19:39:10.393 10264  9448 10024 E AndroidRuntime:
    at org.apache.xmlbeans.impl.store.Saver.<init>(Saver.java:123)03-04 19:39:10.393 10264  9448 10024 E AndroidRuntime:
    at org.apache.xmlbeans.impl.store.Saver$TextSaver.<init>(Saver.java:916)03-04 19:39:10.393 10264  9448 10024 E AndroidRuntime:
    at org.apache.xmlbeans.impl.store.Cursor._xmlText(Cursor.java:546)03-04 19:39:10.393 10264  9448 10024 E AndroidRuntime:
    at org.apache.xmlbeans.impl.store.Cursor.xmlText(Cursor.java:2436)03-04 19:39:10.393 10264  9448 10024 E AndroidRuntime:
    at org.apache.xmlbeans.impl.values.XmlObjectBase.xmlText(XmlObjectBase.java:1500)03-04 19:39:10.393 10264  9448 10024 E AndroidRuntime:
    at org.apache.xmlbeans.impl.values.XmlObjectBase.toString(XmlObjectBase.java:1485)03-04 19:39:10.393 10264  9448 10024 E AndroidRuntime:
    at org.apache.poi.POIXMLProperties.commit(POIXMLProperties.java:211)03-04 19:39:10.393 10264  9448 10024 E AndroidRuntime:
    at org.apache.poi.POIXMLDocument.write(POIXMLDocument.java:225)
-- | --
03-04 19:39:10.393 10264  9448 10024 E AndroidRuntime: java.lang.IncompatibleClassChangeError: Class 'org.apache.xmlbeans.impl.store.Saver$DocSaveCur' does not implement interface 'java.util.List' in call to 'int java.util.List.size()' (declaration of 'org.apache.xmlbeans.impl.store.Saver' appears in base.apk!classes4.dex)03-04 19:39:10.393 10264  9448 10024 E AndroidRuntime:
    at org.apache.xmlbeans.impl.store.Saver.pushMappings(Saver.java:546)03-04 19:39:10.393 10264  9448 10024 E AndroidRuntime:
    at org.apache.xmlbeans.impl.store.Saver.processElement(Saver.java:406)03-04 19:39:10.393 10264  9448 10024 E AndroidRuntime:
    at org.apache.xmlbeans.impl.store.Saver.process(Saver.java:307)03-04 19:39:10.393 10264  9448 10024 E AndroidRuntime:
    at org.apache.xmlbeans.impl.store.Saver.<init>(Saver.java:123)03-04 19:39:10.393 10264  9448 10024 E AndroidRuntime:
    at org.apache.xmlbeans.impl.store.Saver$TextSaver.<init>(Saver.java:916)03-04 19:39:10.393 10264  9448 10024 E AndroidRuntime:
    at org.apache.xmlbeans.impl.store.Cursor._xmlText(Cursor.java:546)03-04 19:39:10.393 10264  9448 10024 E AndroidRuntime:
    at org.apache.xmlbeans.impl.store.Cursor.xmlText(Cursor.java:2436)03-04 19:39:10.393 10264  9448 10024 E AndroidRuntime:
    at org.apache.xmlbeans.impl.values.XmlObjectBase.xmlText(XmlObjectBase.java:1500)03-04 19:39:10.393 10264  9448 10024 E AndroidRuntime:
    at org.apache.xmlbeans.impl.values.XmlObjectBase.toString(XmlObjectBase.java:1485)03-04 19:39:10.393 10264  9448 10024 E AndroidRuntime:
    at org.apache.poi.POIXMLProperties.commit(POIXMLProperties.java:211)03-04 19:39:10.393 10264  9448 10024 E AndroidRuntime:
    at org.apache.poi.POIXMLDocument.write(POIXMLDocument.java:225)
centic9 commented 2 years ago

Sounds like you include an outdated or wrong version of the xmlbeans dependency, I'd check which libraries are included in the project via other dependencies and make sure that xlmbeans is only included with the exact version that is required by Apache POI.

centic9 commented 2 years ago

Closing this one for now as I believe it is a local mismatch of the xmlbeans dependency. Make sure you only have the exact required version of xmlbeans jar in place and reopen with more information if it still does not work, ideally with a small app which can be used to reproduce the problem.