Android NDK, could not find dependent library -


i tried implement ndk shared library needed other external native library compiled in linux .so file.

i have following relationship: libl1 depends on libl2.

i tried prebuilt libl2.so shared , added libl1 module. compiled fine , on lg nexus 4 works fine when load libl1 this:

static {   system.loadlibrary('l1'); } 

but doesn't work on samsung 4.03 android version. in device works code:

static {   system.loadlibrary('l2');   system.loadlibrary('l1'); } 

i found android classloader can not load dependency. why work fine on nexus 4? not samsung device?

the behavior see on nexus4 not expected, , tested again there no special treatment, @ least on v. 4.2.2 (build jdq39). maybe have other android installed on nexus? maybe device happens have file /system/lib/libl2.so reason?

the behavior of samsung device expected, , android team thinks correct. shared libraries must loaded in order of dependency java, or can call dlopen() explicitly if wish, loose simplicity of using linker resolve function references across these shared libraries you.


Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -