Guye Incognito
Guye Incognito

Reputation: 2830

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

I'm building a native C++ library for Android, for use with a Unity 3d project.
I want to build for arm and x86, so I set this in application.mk

APP_ABI := all

This gives me several seperate .so files. Unfortunately currently the way to include an native android library in a unity app is to add the library to the folder assets\Plugins\Android. I can only put one file with the libraries name in that folder. So i can only have one of the .so files in there. Is there any way of merging them into one file?

Upvotes: 2

Views: 2171

Answers (2)

Dan Albert
Dan Albert

Reputation: 10499

Merging multiple architectures into a single .so can't be done on Linux.

That requires fat binrary support, and the FatELF project is now dead.

Upvotes: 0

Ghopper21
Ghopper21

Reputation: 10477

You can put multiple .so files, one for each architecture, into the Plugins/Assets folder, per the Unity documentation:

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/

Upvotes: 2

Related Questions