Download

Packaging a ".so" library in a plug-in for the Quest

Hello!

I’m having trouble packaging a project with a plug-in with a library for Oculus Quest.

Simply put:
(1) I have a project called “MyPluginSample”
(2) the project contains a plug-in called “MyPlugin”
(3) the plug-in contains a pre-build library “MyLibrary”, both as .DLL for windows and .so for the Quest

I’m using the same library (DLL/SO) files in the Unity version of the plug-in, so I’m quite confident they are okay.
It’s also working fine on Windows, both in the Editor and packaged.

But when I package and run it on the Quest, it immediately crashes.
Logcat outputs the following:

java.lang.UnsatisfiedLinkError: dlopen failed: library "libmyplugin.so" not found
 	at java.lang.Runtime.loadLibrary0(Runtime.java:1071)
 	at java.lang.Runtime.loadLibrary0(Runtime.java:1007)
 	at java.lang.System.loadLibrary(System.java:1667)
 	at com.epicgames.ue4.GameActivity.<clinit>(GameActivity.java:6534)

Which I found confusing - why does it look for a “libmyplugin.so”?
I did a search of the whole project folder and found that the file name is in many binary files (including libUE4.so), but not any settings/source file.
Admittedly, when the “libMyLibrary.so” file is build (outside of Unreal), it is called “libmyplugin.so” and just later renamed to avoid confusion.
Usually this should not matter, but to be sure I renamed it back to “libmyplugin.so”, adjusted the .build.cs file and packaged it again, but the same error remained.

So I checked the .APK and .OBB files and noticed it’s only in the .OBB file.
To be sure that that isn’t a problem, I also added an APL XML file to the project which copies the .SO file into the APK.
Then, the crashing stopped, but the app also never starts (getting stuck on the “…” loading splash screen).

I’m profoundly confused since when I look at other projects, none of this seems to be necessary.

Does anyone have any idea why it’s looking for a “libmyplugin.so” and what it expects to find in it?

I’m on UE 4.26.

Thanks in advance for any ideas!