Skip to content

Commit 4ed8c45

Browse files
authored
Merge pull request godotengine#110263 from raulsntos/dotnet/android-net9.0
[.NET] Require `net9.0` for Android exports
2 parents 9edc290 + f0c9253 commit 4ed8c45

File tree

4 files changed

+9
-3
lines changed

4 files changed

+9
-3
lines changed

modules/mono/editor/GodotTools/GodotTools.ProjectEditor/ProjectGenerator.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ public static ProjectRootElement GenGameProject(string name)
2626
var mainGroup = root.AddPropertyGroup();
2727
mainGroup.AddProperty("TargetFramework", GodotMinimumRequiredTfm);
2828

29+
// Non-gradle builds require .NET 9 to match the jar libraries included in the export template.
30+
var net9 = mainGroup.AddProperty("TargetFramework", "net9.0");
31+
net9.Condition = " '$(GodotTargetPlatform)' == 'android' ";
32+
2933
mainGroup.AddProperty("EnableDynamicLoading", "true");
3034

3135
string sanitizedName = IdentifierUtils.SanitizeQualifiedIdentifier(name, allowEmptyIdentifiers: true);
4.34 KB
Binary file not shown.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
https://www.nuget.org/packages/Microsoft.NETCore.App.Runtime.Mono.android-arm64/9.0.4

platform/android/export/export_plugin.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2739,6 +2739,7 @@ bool _validate_dotnet_tfm(const String &required_tfm, String &r_error) {
27392739
List<String> args;
27402740
args.push_back("build");
27412741
args.push_back(project_path);
2742+
args.push_back("/p:GodotTargetPlatform=android");
27422743
args.push_back("--getProperty:TargetFramework");
27432744

27442745
int exitcode;
@@ -2778,9 +2779,9 @@ bool EditorExportPlatformAndroid::has_valid_export_configuration(const Ref<Edito
27782779
err += TTR("Exporting to Android when using C#/.NET is experimental.") + "\n";
27792780

27802781
if (!gradle_build_enabled) {
2781-
// For template exports we only support .NET 8 because the template
2782-
// includes .jar dependencies that may only be compatible with .NET 8.
2783-
if (!_validate_dotnet_tfm("net8.0", err)) {
2782+
// For template exports we only support .NET 9 because the template
2783+
// includes .jar dependencies that may only be compatible with .NET 9.
2784+
if (!_validate_dotnet_tfm("net9.0", err)) {
27842785
r_error = err;
27852786
return false;
27862787
}

0 commit comments

Comments
 (0)