Android O apk calls jni library and reports error dlopen failed

To debug the external FM module, I have provided a jni dynamic interface library for app to call.
The error encountered is as follows:
"app_crashed_reason": "java.lang.UnsatisfiedLinkError: dlopen failed: library "/system/lib64/libextFm_jni_fm_omr1.so" needed or dlopened by "/system/lib64/libnativeloader.so" is not accessible for the namespace "Classloader-namespace"\n\tat java.lang.Runtime.loadLibrary0(Runtime.java:1016)\n\tat java.lang.System.loadLibrary(System.java:1657)\n\tat com.android.fmradio .ExtFm.(ExtFm.java:7)\n\tat com.android.fmradio.ExtFm.openDev(Native Method)\n\tat com.android.fmradio.FmAdapter.openDev(FmAdapter.java:29)\n\ tat cn.xxx.xxx.xxxx.module.radio.component.mtk.MtkRadioHandler.openDevice

When overwriting the installed app to load jni so with dlopen, you need to pay attention
to adding the name of the corresponding so in the corresponding system/etc/public.libraries.txt ,

In addition, if it is a third-party so, it is recommended to build so under the vendor, and then add it to the corresponding vendor/etc/public.libraries.txt

For this debugging, I also need to root the device.

Guess you like

Origin blog.csdn.net/jeephao/article/details/104482400