2

I use a third/second-party native library (called libmc_eruconverter_lv2_for_android_jni.so) and am trying to debug an fatal exception which ONLY occurred when my app runs on Android L (5.0).

10-23 12:43:03.513: E/art(2177):
dlopen("/data/app/com.ocean.web3d.lib-2/lib/arm/libmc_eruconverter_lv2_for_android_jni.so",
RTLD_LAZY) failed: dlopen failed: could not load library "libdvm.so"
needed by "libmc_eruconverter_lv2_for_android_jni.so"; caused by library
"libdvm.so" not found
10-23 12:43:03.514: D/AndroidRuntime(2177): Shutting down VM
10-23 12:43:03.514: D/AndroidRuntime(2177): --------- beginning of crash
10-23 12:43:03.515: E/AndroidRuntime(2177): FATAL EXCEPTION: main
10-23 12:43:03.515: E/AndroidRuntime(2177): Process:
com.ocean.web3d.lib, PID: 2177
10-23 12:43:03.515: E/AndroidRuntime(2177):
java.lang.UnsatisfiedLinkError: dlopen failed: could not load library
"libdvm.so" needed by "libmc_eruconverter_lv2_for_android_jni.so"; caused
by library "libdvm.so" not found
10-23 12:43:03.515: E/AndroidRuntime(2177): at
java.lang.Runtime.loadLibrary(Runtime.java:371)
10-23 12:43:03.515: E/AndroidRuntime(2177): at
java.lang.System.loadLibrary(System.java:989)
10-23 12:43:03.515: E/AndroidRuntime(2177): at
com.ocean.web3d.lib.oceanRenderer.<clinit>(oceanRenderer.java:18)

In order to fix this problem, I have tried to renew my development environment from: ATD 23.02 (Eclipse 4.2.2) with NDK r8c to: ATD 23.04 (Eclipse JUNO) with NDK r10c

(FYI, I have got a link warning, so I modified my Android.mk file and the warning is fixed not now by referring to this thread WARNING: .../Android.mk: non-system libraries in linker flags )

Also, in Application.mk, I have set my APP_PLATFORM to 21

However, I still have got the fatal exception. I have almost tried what I can try... Could anyone kindly help or give me some ideas? Thank you very much in advance!

Community
  • 1
  • 1
Fred Hui
  • 31
  • 6
  • 3
    It looks like your existing library is - **quite unwisely** - linked against internals of the older Dalvik VM's implementation. Your device uses the newer Android Runtime engine instead, so it doesn't have whatever private API the old library is trying to abuse. Likely you need to either rebuild your library from source (and hopefully clean it up in the process!) or else embark on the (likely intricate and desperate) project of trying to create a wrapper to emulate the old functionality on top of the new. – Chris Stratton Oct 23 '14 at 16:36
  • Hi Chris, Thank you very much for your reply. Since I don't have the source of that library... So at the moment, your second method sounds interesting to me but first of all, is it possible to see what kind of functions from libdvm.lib the library uses? Thank you! – Fred Hui Oct 30 '14 at 03:34
  • 1
    Yes, you can see some of that with the ndk's objdump, but there's also a newer tool ndk-depends http://stackoverflow.com/questions/15534104/ldd-equivalent-on-android – Chris Stratton Oct 30 '14 at 06:20
  • WOW! A big step forward!!! I did find some hints by using ndk-depends and objdump. Thank you very much! I really appreciate it! The other things I would like to know is, what kind of symbols(functions) the library expect to import from libdvm.so?? objdump -d gives me all the assembly code, I wonder if it is technically feasible to know the functions which the library use... Maybe I should find the header file related to libdvm.so in old ndk!?!?!? Thanks! – Fred Hui Nov 01 '14 at 14:07

0 Answers0