Android: java.lang.reflect.UndeclaredThrowableException from com.sun.star.ucb.ContentCreationException: Unable to create Content
Tor Lillqvist
tml at iki.fi
Fri Mar 30 08:48:29 PDT 2012
Argh, I think I know the problem. My own mistake...
I forgot to execute the run-time binary patching of a bug in the NDK's
shared GNU C++ library... without that patch, catching exceptions
thrown in another shared object doesn't work.
I am experimenting with
http://cgit.freedesktop.org/libreoffice/core/tree/android/experiments/DocumentLoader/src/org/libreoffice/android/examples/DocumentLoader.java
, which unlike the unit test stuff in android/qa/sc does not use a
subclass of Android's NativeActivity (or of our Bootstrap class,
http://cgit.freedesktop.org/libreoffice/core/tree/android/Bootstrap/src/org/libreoffice/android/Bootstrap.java,
which is a subclass of NativeActivity).
Thus android_main(),
http://cgit.freedesktop.org/libreoffice/core/tree/sal/android/lo-bootstrap.c#n1617
doesn't get executed. And it's android_main() that calls
patch_libgnustl_shared(),
http://cgit.freedesktop.org/libreoffice/core/tree/sal/android/lo-bootstrap.c#n1373
.
So I just need to call (its JNI wrapper)
Bootstrap.patch_libgnustl_shared() and cross-shared-library exception
handling should work fine. Knock on wood...
Yeah, I probably should move the patch_libgnustl_shared() call to the
setup() function, so that it isn't forgotten so easily...
--tml
More information about the LibreOffice
mailing list