Open wenbingzhang opened 2 years ago
Not only Android, but also Mac OS. Other platforms have not been tested yet.
The NLua NuGet package has a dependency on KeraLua which is the NuGet package that includes the liblua54.so
file (the native library that KeraLua dlopens using DllImport).
Both NLua.dll and KeraLua.dll are included in the .mono/assemblies/Debug
, the Mono export plugin manually copies these DLLs by iterating the game project's dependencies:
This means the Mono export plugin only copies the referenced assemblies and not other files included in the NuGet packages (like native libraries). I assume if we were using dotnet publish
this would just work and it would do the right thing, we are already moving to dotnet publish
for exporting in Godot 4.0 (currently implemented in branch dotnet6
) but, unfortunately, I don't think it'd be backported to 3.x.
The only workaround would be to copy the native libraries to a path where the game can find them which is not a simple task in an OS like Android. For an OS like Mac, having the .so files next to the binary should work.
Sounds like a duplicate of #22787
Android Using "gdnlib" can copy so to apk, and it can be used normally.
macos Mono' cannot call lib in' xxx.app/Contents/Frameworks'
Godot version
mono 3.4.4.stable
System information
macos 11.6
Issue description
Runtimes in the nuget package cannot be copied to the android library correctly.
Steps to reproduce
Lua is not included in "libs" in "apk" exported from Android.
Minimal reproduction project
test.zip