调试外置FM模块,我这边提供了一个jni的动态接口库,供app去调用。
遇到报错如下:
“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
覆盖安装的app去用dlopen加载jni so时,需要注意在对应的system/etc/public.libraries.txt
中添加上对应so的名称,
另外,如果是第三方的so,建议把so内置到vendor下,然后添加到对应的vendor/etc/public.libraries.txt
对于我的这次调试还需要设备root.