我需要将 .so 文件复制到 System/libs 吗?

Do i need to copy .so files to System/libs?

我想让我的应用程序成为系统应用程序。但是当我将它作为系统应用程序时(将 .apk 文件放在 System/app 中),我的应用程序崩溃了。 它崩溃是因为它无法加载 .so 文件。

我的第一个问题是我是否需要在 System/libs 中复制库(提取 .apk 并且我将获得库)或系统自动执行它?

我的第二个问题是系统是否从 System/libs 或 data/data/myApp.PackageName/lib 文件夹加载库(.so 文件)?

如有任何帮助,我们将不胜感激。

My first question here is do i need to copy the libs( Extract .apk and i will be getting libs) inside System/libs or the System automatically does it?

您不需要手动复制 .so 文件。

但是,请仔细检查为什么

It crashes because its not able to load .so files.

您需要确保您的目标 phone 具有相应的 ABI,例如您的真实设备需要 arm64-v8a,但此 ABI 不适用于模拟器 ,因为模拟器通常是 x86x86_64

My Second question here is does the system load libraries(.so files) from System/libs or data/data/myApp.PackageName/lib folder?

来自 data/data/myApp.PackageName/lib