I have no idea because AOT does not support cross-OS compilation (I successfully compiled the Linux-64 version using WSL, but I wasn’t able to compile it for Android). Even if I manage to compile and export the .so file, I don’t know how to tell Godot about it.
Even if I manage to compile and export the .so file, I don’t know how to tell Godot about it.
You are not supposed to build the project yourself, use the Export dialog in the Godot editor. To enable NativeAOT follow the instructions in the Microsoft documentation: Native AOT deployment overview - .NET | Microsoft Learn
When I export to Android via the Godot editor, I get the error: Cross-OS native compilation is not supported. C:\Users\TrifingZW\.nuget\packages\microsoft.dotnet.ilcompiler\8.0.8\build\Microsoft.NETCore.Native.Publish.targets(60,5).
I manually compiled the C# solution successfully using the following command:
This successfully compiled the solution to C:\Users\TrifingZW\GodotProjects\BtlEditor\.godot\mono\temp\bin\ExportRelease\linux-bionic-arm64\native\BtlEditor.so.
I manually published the dotnet project to a .so file and manually included the .so file into the pck. It successfully ran, and then I automated this process using a Python script. The problem has been solved, thank you very much!