poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nolan Darilek <no...@thewordnerd.info>
Subject Reading/writing DocX on Android
Date Sun, 12 Oct 2014 02:11:38 GMT

I'm having a very hard time trying to use XWPFDocument on Android. Seems
like I've read everything I can find from Google on the subject, but am
still hitting an issue. In particular, here's part of the exception I'm
getting when I try to write a DocX from an Android app:

E/AndroidRuntime( 2553): java.lang.NoSuchMethodError:

E/AndroidRuntime( 2553):     at

E/AndroidRuntime( 2553):     at

E/AndroidRuntime( 2553):     at

E/AndroidRuntime( 2553):     at

E/AndroidRuntime( 2553):     at

E/AndroidRuntime( 2553):     at

E/AndroidRuntime( 2553):     at

E/AndroidRuntime( 2553):     at

I understand the issues on Android are 2-fold. 1: the method limit. I
haven't seemed to hit that yet, so I haven't needed to shrink the POI jars.

2. The use of javax.* namespaces. Many of the solutions I saw on Google
involved manually opening the jars and replacing "javax" with something
else, like "avax". For this I used Jarjar and the Gradle plugin for
same, with a rule like:

"rule javax.** avax.@1"

The resulting fat jar appears to have its javax namespace renamed, and
indeed, I can't find the string "javax" anywhere when grepping through
the directories.

I'm also not sure if I need to manually install stax-api. It appears to
be installed as a POI dependency, but installing stax:stax-api:1.0.1
doesn't seem to make much of a difference.

Any idea as to why I'm getting this NoSuchMethodError? Guessing it has
to be something found on the JVM but not Dalvik, but I can't figure out
what that is and am quickly approaching my wits' end. Do I have to do
anything to tell POI to use the javax.xml.* facilities provided by
stax-api and not expect to find them on the VM running it? Or is there
something else I'm missing?


To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org

View raw message