标签:
Bionic libc doesn‘t load dependencies for current .so file (diff from Windows or Linux)
so a explicit calling of Java‘s System.loadLibrary() is needed, in order to load depedency libraries. otherwise the original .so will fail to load.
JNI_OnLoad will be called mostly on System.LoadLibrary() or equavilent calls
System.loadLibrary("gnustl_shared");
the .so file is loaded & and symbol get loaded by common dynamic library function:
if the symbol "JNI_OnLoad" is not found in the lib, dalvik will simply do nothing, but a Debug Log: No JNI_OnLoad found in xxx.so, skipping init.
details at:
NatvieAcitviy: JNI_OnLoad is not get called
For the startup library speicified by "android.app.lib_name", JNI_OnLoad is not get called,
only libs loaded by System.loadLibrary() will.
[工作积累] Android dynamic library & JNI_OnLoad
标签:
原文地址:http://www.cnblogs.com/crazii/p/4207642.html