(StringComparer.OrdinalIgnoreCase);
- foreach (var file in InputRemapXmlFiles) {
- if (!seen.Add (file.ItemSpec)) {
- continue;
+ if (InputRemapXmlFiles != null) {
+ foreach (var file in InputRemapXmlFiles) {
+ if (!seen.Add (file.ItemSpec)) {
+ continue;
+ }
+ MergeInputFile (writer, file.ItemSpec);
}
- MergeInputFile (writer, file.ItemSpec);
}
writer.WriteEndElement ();
}
diff --git a/src/Xamarin.Android.Build.Tasks/Tasks/StripNativeLibraries.cs b/src/Xamarin.Android.Build.Tasks/Tasks/StripNativeLibraries.cs
index 3c9925099cf..5a168856a72 100644
--- a/src/Xamarin.Android.Build.Tasks/Tasks/StripNativeLibraries.cs
+++ b/src/Xamarin.Android.Build.Tasks/Tasks/StripNativeLibraries.cs
@@ -20,15 +20,15 @@ public class StripNativeLibraries : AndroidToolTask
public ITaskItem []? DestinationFiles { get; set; }
- string triple;
- ITaskItem source;
- ITaskItem destination;
+ string? triple;
+ ITaskItem? source;
+ ITaskItem? destination;
public override bool RunTask ()
{
- if (SourceFiles.Length != DestinationFiles.Length)
+ if (SourceFiles == null || DestinationFiles == null || SourceFiles.Length != DestinationFiles.Length)
throw new ArgumentException ("source and destination count mismatch");
- if (SourceFiles == null || SourceFiles.Length == 0)
+ if (SourceFiles.Length == 0)
return true;
for (int i = 0; i < SourceFiles.Length; i++) {
From 69c5442eed0e245246bb001daa24d1e47fbb0a0d Mon Sep 17 00:00:00 2001
From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com>
Date: Fri, 11 Jul 2025 22:15:56 +0000
Subject: [PATCH 12/13] Fix remaining 5 nullable reference type compilation
errors
Co-authored-by: jonathanpeppers <840039+jonathanpeppers@users.noreply.github.com>
---
.../Tasks/LinkApplicationSharedLibraries.cs | 2 ++
src/Xamarin.Android.Build.Tasks/Tasks/StripNativeLibraries.cs | 4 ++--
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/Xamarin.Android.Build.Tasks/Tasks/LinkApplicationSharedLibraries.cs b/src/Xamarin.Android.Build.Tasks/Tasks/LinkApplicationSharedLibraries.cs
index b50266e4318..ba184b12194 100644
--- a/src/Xamarin.Android.Build.Tasks/Tasks/LinkApplicationSharedLibraries.cs
+++ b/src/Xamarin.Android.Build.Tasks/Tasks/LinkApplicationSharedLibraries.cs
@@ -56,6 +56,8 @@ public override System.Threading.Tasks.Task RunTaskAsync ()
void RunLinker (Config config)
{
+ if (config.Linker == null || config.OutputSharedLibrary == null || config.LinkItems == null)
+ return;
config.Linker.Link (config.OutputSharedLibrary, config.LinkItems);
}
diff --git a/src/Xamarin.Android.Build.Tasks/Tasks/StripNativeLibraries.cs b/src/Xamarin.Android.Build.Tasks/Tasks/StripNativeLibraries.cs
index 5a168856a72..fc753b82e71 100644
--- a/src/Xamarin.Android.Build.Tasks/Tasks/StripNativeLibraries.cs
+++ b/src/Xamarin.Android.Build.Tasks/Tasks/StripNativeLibraries.cs
@@ -67,8 +67,8 @@ public override bool RunTask ()
protected override string GenerateCommandLineCommands ()
{
var cmd = new CommandLineBuilder ();
- cmd.AppendSwitchIfNotNull ("--strip-debug ", source.ItemSpec);
- cmd.AppendSwitchIfNotNull ("-o ", destination.ItemSpec);
+ cmd.AppendSwitchIfNotNull ("--strip-debug ", source?.ItemSpec);
+ cmd.AppendSwitchIfNotNull ("-o ", destination?.ItemSpec);
return cmd.ToString ();
}
From baf6a1388f15987613ebc3046b81e38f508fb455 Mon Sep 17 00:00:00 2001
From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com>
Date: Mon, 14 Jul 2025 15:21:38 +0000
Subject: [PATCH 13/13] Fix AndroidApkSigner nullable SDK version handling
Co-authored-by: jonathanpeppers <840039+jonathanpeppers@users.noreply.github.com>
---
.../Tasks/AndroidApkSigner.cs | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/src/Xamarin.Android.Build.Tasks/Tasks/AndroidApkSigner.cs b/src/Xamarin.Android.Build.Tasks/Tasks/AndroidApkSigner.cs
index 7e5f790fb8e..6c3000d4986 100644
--- a/src/Xamarin.Android.Build.Tasks/Tasks/AndroidApkSigner.cs
+++ b/src/Xamarin.Android.Build.Tasks/Tasks/AndroidApkSigner.cs
@@ -74,15 +74,16 @@ protected override string GenerateCommandLineCommands ()
var cmd = new CommandLineBuilder ();
var manifest = AndroidAppManifest.Load (ManifestFile.ItemSpec, MonoAndroidHelper.SupportedVersions);
- int minSdk = MonoAndroidHelper.SupportedVersions.MinStableVersion?.ApiLevel ?? 1;
- int maxSdk = MonoAndroidHelper.SupportedVersions.MaxStableVersion?.ApiLevel ?? 1;
+ int? minSdk = MonoAndroidHelper.SupportedVersions.MinStableVersion?.ApiLevel;
+ int? maxSdk = MonoAndroidHelper.SupportedVersions.MaxStableVersion?.ApiLevel;
if (manifest.MinSdkVersion.HasValue)
minSdk = manifest.MinSdkVersion.Value;
if (manifest.TargetSdkVersion.HasValue)
maxSdk = manifest.TargetSdkVersion.Value;
- minSdk = Math.Min (minSdk, maxSdk);
+ if (minSdk.HasValue && maxSdk.HasValue)
+ minSdk = Math.Min (minSdk.Value, maxSdk.Value);
cmd.AppendSwitchIfNotNull ("-jar ", ApkSignerJar);
cmd.AppendSwitch ("sign");
@@ -97,8 +98,12 @@ protected override string GenerateCommandLineCommands ()
AddStorePass (cmd, "--key-pass", KeyPass);
}
- cmd.AppendSwitchIfNotNull ("--min-sdk-version ", minSdk.ToString ());
- cmd.AppendSwitchIfNotNull ("--max-sdk-version ", maxSdk.ToString ());
+ if (minSdk is not null) {
+ cmd.AppendSwitchIfNotNull ("--min-sdk-version ", minSdk.ToString ());
+ }
+ if (maxSdk is not null) {
+ cmd.AppendSwitchIfNotNull ("--max-sdk-version ", maxSdk.ToString ());
+ }
if (!AdditionalArguments.IsNullOrEmpty ())
pFad - Phonifier reborn
Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies:
Alternative Proxy
pFad Proxy
pFad v3 Proxy
pFad v4 Proxy