android jni

时间:2021-09-11 15:26:47

1, java.lang.UnsatisfiedLinkError: Couldn't load xxxxx: findLibrary returned null

当 apk 是被放到 /system/app 下,这时它找 so 的路径变为了:=/data/app-lib/iSetting(apk的名字)

报错log:

07-23 22:41:29.124: E/AndroidRuntime(9209): Caused by: java.lang.UnsatisfiedLinkError: Couldn't load hello from loader dalvik.system.PathClassLoader[dexPath=/system/app/iSetting.apk,libraryPath=/data/app-lib/iSetting]: findLibrary returned null

这时,找到so,push上去即可:adb push libhello.so /data/app-lib/iSetting