Android7.1--java.lang.UnsatisfiedLinkError问题

RK3399开机碰到卡在开机logo,出错日志如下:

01-18 09:43:09.362 24822 24822 E Zygote  : Zygote died with exception
01-18 09:43:09.362 24822 24822 E Zygote  : java.lang.UnsatisfiedLinkError: Unable to create namespace for the classloader dalvik.system.PathClassLoader[DexPathList[[zip file "/system/framework/services.jar", zip file "/system/framework/ethernet-service.jar", zip file "/system/framework/wifi-service.jar"],nativeLibraryDirectories=[/system/lib64, /vendor/lib64, /system/lib64, /vendor/lib64]]]: android_init_namespaces failed: error initializing public namespace: a library with soname "libaudiorecord.so" was not found in the default namespace
01-18 09:43:09.362 24822 24822 E Zygote  : 	at com.android.internal.os.PathClassLoaderFactory.createClassLoader(PathClassLoaderFactory.java:54)
01-18 09:43:09.362 24822 24822 E Zygote  : 	at com.android.internal.os.ZygoteInit.createSystemServerClassLoader(ZygoteInit.java:571)
01-18 09:43:09.362 24822 24822 E Zygote  : 	at com.android.internal.os.ZygoteInit.handleSystemServerProcess(ZygoteInit.java:547)
01-18 09:43:09.362 24822 24822 E Zygote  : 	at com.android.internal.os.ZygoteInit.startSystemServer(ZygoteInit.java:699)
01-18 09:43:09.362 24822 24822 E Zygote  : 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:794)
01-18 09:43:09.362 24822 24822 D AndroidRuntime: Shutting down VM

出错信息里面比较关键的是android_init_namespaces failed: error initializing public namespace: a library with soname “libaudiorecord.so” was not found in the default namespace。
发现在/system/lib与/system/lib64下均没有libaudiorecord.so这个库。
再看几个public.libraries.txt配置里面是有增加这个库的白名单的。
public.libraries.so一共有三个,位置分别是在:
/system/etc/public.libraries.txt
/vendor/etc/public.libraries.txt
如下图:

R61H:/ $ cat /vendor/etc/public.libraries.txt                                  
libGLES_mali.so
librga.so
libvdk.so
libaudiorecord.so

在devices.mk里面把libaudiorecord.so的编译打开,系统能正常开机。
应用理论上只可以访问NDK提供的本地库和应用自带的本地库。但实际上应用也经常需要使用系统库,每个应用都将系统库打包到自己中未免太浪费了。所以Android还提供了应用访问系统库的方法,通过public.libraries.txt设置白名单。
看起来public.libraries.txt定义的必须实际上要有对应的so库与之对应,否则zygote会出错,具体流程代码后续补上。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值