I made a native extension for Flex which works fine. When calling Java functions from Flex I get the desired result. But if I want to load a shared library in Java the application crashes at startup.
The code for loading the library:
public static void loadLibrary(String sLibName) {
try {
System.loadLibrary(sLibName);
} catch(UnsatisfiedLinkError e) {
(...)
@Override
public void initialize() {
// called when the native extension is ready to be used
Debug.info("Extension initialized");
loadLibrary("Native");
Logcat gives me the following log report:
01-18 15:14:25.824: I/ColijnIT-AR(15349): Extension initialized
01-18 15:14:25.824: D/dalvikvm(15349): Trying to load lib /data/data/air.NativeJavaTest.debug/lib/libNative.so 0x41312378
01-18 15:14:25.834: D/dalvikvm(15349): Added shared lib /data/data/air.NativeJavaTest.debug/lib/libNative.so 0x41312378
01-18 15:14:25.834: W/System.err(15349): java.lang.NoClassDefFoundError: java/util/UUID
01-18 15:14:25.834: W/System.err(15349): at java.lang.Runtime.nativeLoad(Native Method)
01-18 15:14:25.834: W/System.err(15349): at java.lang.Runtime.loadLibrary(Runtime.java:368)
01-18 15:14:25.834: W/System.err(15349): at java.lang.System.loadLibrary(System.java:535)
If I remove the loadLibrary("Native") call in the method initialize I get no errors and everything works fine. But when the library is succesfully done loading and is added (according to logcat) it gives me the NoClassDefFoundError