DLLNotFoundException on Oculus/Android

My Unity project uses a native plugin with different builds for different platforms (Windows, Mac, Android for now). I’m able to invoke calls to the native plugin with no issues in Windows and Mac, but building to Android always results in a “DLLNotFoundException” error.

The name supplied to “DLLImport” is correct, and the name of the plugin is formatted correctly (“lib” prefix with “.so” extension). The plugin appears in the unzipped APK, in lib/arm64-v8a. The plugin is built for ARM64, which is reflected both in the Unity metadata and in the Player settings.

Why can’t unity find this native plugin?

This would be the first assumption I would investigate.

For instance, my KurtMaster2D game has a native C DLL that I build for Mac, iOS, Android and Windows, plus I have a legacy stub for it too.

Each one of those things has a subtly different C# binding, as seen here:

https://pastebin.com/htxTURUP

For instance vanilib is the internal name of the library, but the library archive itself is vanilla-release.aab. It is NOT a bare .so but rather part of the aab file dropped into Unity.

On iOS it’s just that __Internal name.

For windows the DLL is indeed libtest1.dll and for MacOSX it is the bundletest1.bundle bundle.