https://groups.google.com/g/android-ndk/c/NEJmlH8nOj4?pli=1
看到這篇討論覺得很有趣,就順便來關注一下這是怎樣的一個問題,1
2
3
4
5load library failed log like these:
needed or dlopened by "/system/lib/libnativeloader.so" is not accessible for the namespace:
[name="classloader-namespace", ld_library_paths="", default_library_paths="",
permitted_paths="/data:/mnt/expand"]
貌似在說明在新版的Android不支援非系統的 so 放在 /system/ 下,要放在 default_library_paths
或 permitted_paths
規定的路徑才能被 load 的起來,
在 android 原始碼中搜尋 is not accessible for the namespace
字樣
結果在 /bionic/linker.cpp 中有加載庫的函數
參考 https://blog.csdn.net/u012459903/article/details/100731487
參考
Namespaces for Native Libraries | Android Open Source Project
https://source.android.com/devices/tech/config/namespaces_libraries#adding-additional-native-libraries
Linker Namespace | Android Open Source Project
https://source.android.com/devices/architecture/vndk/linker-namespace
Enabling the VNDK | Android Open Source Project
https://source.android.com/devices/architecture/vndk/enabling
Android 7.0 行为变更 - NDK 应用链接至平台库 Android Developers
https://developer.android.com/about/versions/nougat/android-7.0-changes?hl=zh-cn#ndk
第三方app加载系统/system/lib下的库–is not accessible for the namespace_Canok-CSDN博客
https://blog.csdn.net/u012459903/article/details/100731487
android N : UnsatisfiedLinkError 只能访问设置为公用库的so库- 鸭子船长 …
https://www.cnblogs.com/zl1991/p/9409462.html
浅谈Android系统编译apk后so文件在dlopen时出现linker权限问题 - CSDN
https://blog.csdn.net/yang542397/article/details/88103951
Android添加自定义公共so库| 码农家园
https://www.codenong.com/cs106357975/
Android Native禁止使用系统私有库详解-阿里云开发者社区
https://developer.aliyun.com/article/748570
Android : 供應商原生開發套件 (VNDK) - sheldon_blogs - 開發者的網上家園
https://www.cnblogs.com/blogs-of-lxl/p/11232754.html
https://developer.android.com/about/versions/nougat/android-7.0-changes.html#ndk
根據官方文檔顯示,android-7.0 開始, 你再也不能使用 dlopen 開啟 system libraries,只有官方的白名單內才能,
hidl_xiaolli的专栏-CSDN博客
https://blog.csdn.net/xiaolli/article/details/79449117
java - library is not accessible for the namespace “classloader-namespace” - Stack Overflow
https://stackoverflow.com/questions/59608865/library-is-not-accessible-for-the-namespace-classloader-namespace
Modify your Android ROM so that those libraries are considered public. This can be done by adding those libraries to /system/etc/public.libraries.txt.
相關參考
AndroidQ 打通應用層到HAL層—(HIDL服務實現)_qq_34211365的博客-CSDN博客
https://blog.csdn.net/qq_34211365/article/details/105556842
Android L開始 APK 64bit 32bit 運行環境原理及決定運行環境的規則_個人文章 - SegmentFault 思否
https://segmentfault.com/a/1190000014161183