From ea324429fd6b80ff071a74ca9081f0c742800c76 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 31 May 2026 02:29:58 +0000 Subject: [PATCH 1/3] Initial plan From 8950cb88393a8f4f1c1f0707832730388182fadf Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 31 May 2026 02:48:46 +0000 Subject: [PATCH 2/3] Plan: Enable nullable and fix null-dereference in GenerateNativeAotEnvironmentAssemblerSources.cs Co-authored-by: jonathanpeppers <840039+jonathanpeppers@users.noreply.github.com> --- .../Tasks/GenerateNativeAotEnvironmentAssemblerSources.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Xamarin.Android.Build.Tasks/Tasks/GenerateNativeAotEnvironmentAssemblerSources.cs b/src/Xamarin.Android.Build.Tasks/Tasks/GenerateNativeAotEnvironmentAssemblerSources.cs index a23748cc237..23d4aaf683f 100644 --- a/src/Xamarin.Android.Build.Tasks/Tasks/GenerateNativeAotEnvironmentAssemblerSources.cs +++ b/src/Xamarin.Android.Build.Tasks/Tasks/GenerateNativeAotEnvironmentAssemblerSources.cs @@ -1,3 +1,5 @@ +#nullable enable + using Microsoft.Android.Build.Tasks; using Microsoft.Build.Framework; using Xamarin.Android.Tools; From c16b5ba46939ff395a0f4fdf54fac300d179f9a2 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 31 May 2026 02:49:07 +0000 Subject: [PATCH 3/3] Enable nullable and fix null-dereference in GenerateNativeAotEnvironmentAssemblerSources.cs Co-authored-by: jonathanpeppers <840039+jonathanpeppers@users.noreply.github.com> --- .../Tasks/GenerateNativeAotEnvironmentAssemblerSources.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Xamarin.Android.Build.Tasks/Tasks/GenerateNativeAotEnvironmentAssemblerSources.cs b/src/Xamarin.Android.Build.Tasks/Tasks/GenerateNativeAotEnvironmentAssemblerSources.cs index 23d4aaf683f..20fd07fa424 100644 --- a/src/Xamarin.Android.Build.Tasks/Tasks/GenerateNativeAotEnvironmentAssemblerSources.cs +++ b/src/Xamarin.Android.Build.Tasks/Tasks/GenerateNativeAotEnvironmentAssemblerSources.cs @@ -31,6 +31,10 @@ public override bool RunTask () // There can be only one, since we run in the inner build ITaskItem? outputFile = GenerateNativeAotLibraryLoadAssemblerSources.FindOutputFile (OutputSources, abi: abi, rid: RID); + if (outputFile == null) { + Log.LogError ($"Could not find output file for ABI '{abi}' and RID '{RID}'"); + return false; + } Log.LogDebugMessage ($"Environment variables file to generate: {outputFile.ItemSpec}"); string environmentLlFilePath = outputFile.ItemSpec; @@ -39,9 +43,9 @@ public override bool RunTask () using var environmentWriter = MemoryStreamPool.Shared.CreateStreamWriter (); bool fileFullyWritten = false; try { - generator.Generate (environmentModule, targetArch, environmentWriter, environmentLlFilePath!); + generator.Generate (environmentModule, targetArch, environmentWriter, environmentLlFilePath); environmentWriter.Flush (); - Files.CopyIfStreamChanged (environmentWriter.BaseStream, environmentLlFilePath!); + Files.CopyIfStreamChanged (environmentWriter.BaseStream, environmentLlFilePath); fileFullyWritten = true; } finally { // Log partial contents for debugging if generation failed