1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-11 13:10:58 +00:00

C#: Load assemblies directly from PCK on Android

Assemblies are now loaded directly from the PCK (`res://`) instead of
a cache directory. This prevents runtime failures that occurred when
the OS cleared cached files (e.g., under low storage), ensuring
the required assemblies are always available.
This commit is contained in:
Youngmin Koo
2025-04-28 11:31:31 +09:00
parent 32eafc18b4
commit b99baa38f1

View File

@@ -169,6 +169,10 @@ private:
String arch = Engine::get_singleton()->get_architecture_name();
String appname_safe = Path::get_csharp_project_name();
String packed_path = "res://.godot/mono/publish/" + arch;
#ifdef ANDROID_ENABLED
api_assemblies_dir = packed_path;
print_verbose(".NET: Android platform detected. Setting api_assemblies_dir directly to pck path: " + api_assemblies_dir);
#else
if (DirAccess::exists(packed_path)) {
// The dotnet publish data is packed in the pck/zip.
String data_dir_root = OS::get_singleton()->get_cache_path().path_join("data_" + appname_safe + "_" + platform + "_" + arch);
@@ -214,6 +218,7 @@ private:
#endif
api_assemblies_dir = data_dir_root;
}
#endif // ANDROID_ENABLED
#endif
}