Android 用于 Unity3d x86 和 Arm 的 ndk-build.. 将多种架构构建到一个 .so 文件中

Android ndk-build for Unity3d x86 and Arm.. Build for multiple architectures into one .so file

我正在为 Android 构建原生 C++ 库,用于 Unity 3d 项目。
我想为 arm 和 x86 构建,所以我在 application.mk

中设置了它
APP_ABI := all

这给了我几个单独的 .so 文件。不幸的是,目前在统一应用程序中包含本机 android 库的方法是将库添加到文件夹 assets\Plugins\Android。 我只能在该文件夹中放置一个具有库名称的文件。所以我只能有其中一个 .so 文件。 有什么办法可以合并成一个文件吗?

您可以根据 Unity documentation:

将多个 .so 文件放入 Plugins/Assets 文件夹中,每个体系结构一个。

For specific Android platform (armv7, x86), the libraries (lib*.so) should be placed in the following:

Assets/Plugins/Android/libs/x86/

Assets/Plugins/Android/libs/armeabi-v7a/

将多个体系结构合并为一个 .so 无法在 Linux 上完成。

这需要 fat binrary 支持,FatELF 项目现已结束。