I successfully cross-compiled a c++ library with the android ndk-Standalone toolchain then, i created a new android application project into Eclipse and when i put mylib.so into the jni folder and execute ndk-build commands it works fine
Prebuilt : mylib.so <= jni/
Install : mylib.so => libs/armeabi/mylib.so
But when adding
static{
System.load("/data/data/my_package/lib/mylib.so");
}
i got an error in the logcat saying
AndroidRuntime
Caused by: java.lang.UnsatisfiedLinkError: Cannot load library:
reloc_library[1306]: 36 cannot locate 'xmlCleanupParser'...``
i googled it but didn't find any way to solve this problem.
People mostly forgot cut "lib" prefix form library name. So if you have "libusb.so" your code must be System.loadLibrary("usb")...
I recently encountered the same error. After trying out dozens of suggestions from SO, I finally figured out that the error was in my native code. even though android ndk had compiled it without any issues / warnings.
Try writing a simple main function to test your native code and compile with g++/gcc (or something similar) to check for errors.
I know its too late for the asker, but hope someone else finds this useful.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With