From 8ec9a3215124e45016c378c77a2bd5712d0f6f86 Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Wed, 22 Apr 2026 09:57:32 -0700 Subject: [PATCH 01/10] [TrimmableTypeMap] Add NativeAOT build test coverage for trimmable type map Parameterize Build_WithTrimmableTypeMap_Succeeds and Build_WithTrimmableTypeMap_IncrementalBuild to run with both CoreCLR and NativeAOT runtimes. NativeAOT uses Release configuration (required). CoreCLR + Release is skipped pending upstream fixes. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../TrimmableTypeMapBuildTests.cs | 34 +++++++++++++++---- 1 file changed, 28 insertions(+), 6 deletions(-) diff --git a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/TrimmableTypeMapBuildTests.cs b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/TrimmableTypeMapBuildTests.cs index 15938fd1439..d64e9f770fb 100644 --- a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/TrimmableTypeMapBuildTests.cs +++ b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/TrimmableTypeMapBuildTests.cs @@ -9,10 +9,21 @@ namespace Xamarin.Android.Build.Tests { public class TrimmableTypeMapBuildTests : BaseTest { [Test] - public void Build_WithTrimmableTypeMap_Succeeds () + public void Build_WithTrimmableTypeMap_Succeeds ([Values] bool isRelease, [Values (AndroidRuntime.CoreCLR, AndroidRuntime.NativeAOT)] AndroidRuntime runtime) { - var proj = new XamarinAndroidApplicationProject (); - proj.SetRuntime (AndroidRuntime.CoreCLR); + if (IgnoreUnsupportedConfiguration (runtime, release: isRelease)) { + return; + } + + if (runtime == AndroidRuntime.CoreCLR && isRelease) { + Assert.Ignore ("CoreCLR + Release trimmable typemap not yet supported"); + return; + } + + var proj = new XamarinAndroidApplicationProject { + IsRelease = isRelease, + }; + proj.SetRuntime (runtime); proj.SetProperty ("_AndroidTypeMapImplementation", "trimmable"); // Full Build will fail downstream (manifest generation not yet implemented for trimmable path), @@ -27,10 +38,21 @@ public void Build_WithTrimmableTypeMap_Succeeds () } [Test] - public void Build_WithTrimmableTypeMap_IncrementalBuild () + public void Build_WithTrimmableTypeMap_IncrementalBuild ([Values] bool isRelease, [Values (AndroidRuntime.CoreCLR, AndroidRuntime.NativeAOT)] AndroidRuntime runtime) { - var proj = new XamarinAndroidApplicationProject (); - proj.SetRuntime (AndroidRuntime.CoreCLR); + if (IgnoreUnsupportedConfiguration (runtime, release: isRelease)) { + return; + } + + if (runtime == AndroidRuntime.CoreCLR && isRelease) { + Assert.Ignore ("CoreCLR + Release trimmable typemap not yet supported"); + return; + } + + var proj = new XamarinAndroidApplicationProject { + IsRelease = isRelease, + }; + proj.SetRuntime (runtime); proj.SetProperty ("_AndroidTypeMapImplementation", "trimmable"); // Full Build will fail downstream (manifest generation not yet implemented for trimmable path), From 8d01100c5cc22f4839cb7349940248ae0e7fb6ac Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Wed, 22 Apr 2026 10:37:11 -0700 Subject: [PATCH 02/10] [NativeAOT] Decouple ILC input wiring from ILLink output Redesign _AndroidComputeIlcCompileInputs to populate IlcCompileInput and IlcReference from @(ResolvedFileToPublish) instead of hardcoding the $(IntermediateLinkDir) path. This matches the SDK contract in Microsoft.NETCore.Native.Publish.targets and works regardless of whether ILLink ran. When _AndroidTypeMapImplementation is 'trimmable': - Remove PrepareForILLink and ILLink from IlcCompileDependsOn - Skip _PrepareLinking dependency in _AndroidBeforeIlcCompile - Skip ILLink-specific settings (RunILLink, SuppressTrimAnalysisWarnings) - Skip _PreTrimmingFixLegacyDesignerUpdateItems in _AndroidRunNativeCompile Fixes #11182 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../Microsoft.Android.Sdk.NativeAOT.targets | 57 ++++++++++++------- 1 file changed, 37 insertions(+), 20 deletions(-) diff --git a/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.NativeAOT.targets b/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.NativeAOT.targets index 14eb57c1134..e52210c2780 100644 --- a/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.NativeAOT.targets +++ b/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.NativeAOT.targets @@ -47,7 +47,7 @@ This file contains the NativeAOT-specific MSBuild logic for .NET for Android. - + _AndroidBeforeIlcCompile; SetupOSSpecificProps; @@ -57,10 +57,21 @@ This file contains the NativeAOT-specific MSBuild logic for .NET for Android. _AndroidComputeIlcCompileInputs; $(IlcCompileDependsOn) + <_AndroidBeforeIlcCompileDependsOn>_PrepareLinking + + + + + _AndroidBeforeIlcCompile; + SetupOSSpecificProps; + ComputeIlcCompileInputs; + _AndroidComputeIlcCompileInputs; + $(IlcCompileDependsOn) + @@ -110,7 +121,10 @@ This file contains the NativeAOT-specific MSBuild logic for .NET for Android. false + + + true - <_IlcManagedInputAssemblies Remove="@(_IlcManagedInputAssemblies)" /> - - - - - <_AndroidILLinkAssemblies Include="@(ManagedAssemblyToLink->'$(IntermediateLinkDir)%(Filename)%(Extension)')" Condition="Exists('$(IntermediateLinkDir)%(Filename)%(Extension)')" /> - + + + <_IlcManagedInputAssemblies Remove="@(_IlcManagedInputAssemblies)" /> + + + + + - - - - - + + + @@ -265,9 +278,13 @@ This file contains the NativeAOT-specific MSBuild logic for .NET for Android. Restore the old scheduling so NativeCompile runs after ComputeResolvedFilesToPublishList in the inner per-RID build. --> + + <_AndroidRunNativeCompileDependsOn Condition=" '$(_AndroidTypeMapImplementation)' != 'trimmable' ">_PreTrimmingFixLegacyDesignerUpdateItems;NativeCompile + <_AndroidRunNativeCompileDependsOn Condition=" '$(_AndroidTypeMapImplementation)' == 'trimmable' ">NativeCompile + + DependsOnTargets="$(_AndroidRunNativeCompileDependsOn)" /> From 2b79e925e57e1f8bfa22f1a984c17fc7a5cd6061 Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Wed, 22 Apr 2026 13:43:53 -0700 Subject: [PATCH 03/10] Condition SuppressTrimAnalysisWarnings restore on non-trimmable path _OriginalSuppressTrimAnalysisWarnings is only set in the ILLink-specific PropertyGroup (non-trimmable path). Without this condition, the restore in _AndroidComputeIlcCompileInputs would clobber SuppressTrimAnalysisWarnings with an empty value in the trimmable path. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../targets/Microsoft.Android.Sdk.NativeAOT.targets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.NativeAOT.targets b/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.NativeAOT.targets index e52210c2780..ab812b48bc6 100644 --- a/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.NativeAOT.targets +++ b/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.NativeAOT.targets @@ -141,7 +141,7 @@ This file contains the NativeAOT-specific MSBuild logic for .NET for Android. - + $(_OriginalSuppressTrimAnalysisWarnings) From b5eee264e2b7d80dc1676ebd705cee5f44c569ba Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Wed, 22 Apr 2026 16:50:30 -0700 Subject: [PATCH 04/10] Update NativeAOT APK size baseline The ILC input wiring change results in a 470 KB size reduction in the native binary (10.2%) because the SDK's _ComputeIlcCompileInputs provides a cleaner set of references for ILC trimming. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../Base/BuildReleaseArm64SimpleDotNet.NativeAOT.apkdesc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Resources/Base/BuildReleaseArm64SimpleDotNet.NativeAOT.apkdesc b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Resources/Base/BuildReleaseArm64SimpleDotNet.NativeAOT.apkdesc index 75e2332c446..77e8bab1a6b 100644 --- a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Resources/Base/BuildReleaseArm64SimpleDotNet.NativeAOT.apkdesc +++ b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Resources/Base/BuildReleaseArm64SimpleDotNet.NativeAOT.apkdesc @@ -8,7 +8,7 @@ "Size": 25400 }, "lib/arm64-v8a/libUnnamedProject.so": { - "Size": 5072296 + "Size": 4601760 }, "META-INF/BNDLTOOL.RSA": { "Size": 1221 @@ -44,5 +44,5 @@ "Size": 1904 } }, - "PackageSize": 2126818 + "PackageSize": 1962978 } \ No newline at end of file From 71665b0b40c32cad100e835557a360773800024b Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Thu, 23 Apr 2026 09:49:02 -0700 Subject: [PATCH 05/10] Update NativeAOT expected warning count to use <= 92 Removing the blanket TrimMode=All rooting for ILC inputs means ILC trims more unused code and produces fewer AOT analysis warnings (120 -> 92). Use Assert.LessOrEqual so the test does not break if warnings decrease further. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../Xamarin.Android.Build.Tests/BuildTest2.cs | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildTest2.cs b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildTest2.cs index 759d6a2f855..741984287bc 100644 --- a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildTest2.cs +++ b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildTest2.cs @@ -478,33 +478,33 @@ public void BuildHasNoWarnings (bool isRelease, bool xamarinForms, bool multidex Assert.IsTrue (b.Build (proj), "Build should have succeeded."); if (runtime == AndroidRuntime.NativeAOT) { - int numberOfExpectedWarnings; + int maxExpectedWarnings; bool validateWarnings; if (xamarinForms && !multidex && packageFormat == "apk") { - // NativeAOT goes nuts here (Nov 2025) with 120 different ILC warnings, too many to verify them here in a way that makes sense - numberOfExpectedWarnings = 120; + // NativeAOT produces ILC warnings for AOT-incompatible patterns in XamarinForms. + maxExpectedWarnings = 92; validateWarnings = false; } else { // NativeAOT currently (Nov 2025) produces 6 `ILC : AOT analysis warning IL3050` warnings for various // bits of code. Even though this test expects no warnings and the above likely make the app not work // correctly at run time, it is still worth running this test under NativeAOT to test for the absence // of other warnings. - numberOfExpectedWarnings = 6; + maxExpectedWarnings = 6; validateWarnings = true; } - Assert.IsTrue ( - StringAssertEx.ContainsText ( - b.LastBuildOutput, - $" {numberOfExpectedWarnings} Warning(s)" - ), - $"{b.BuildLogFile} should have exactly {numberOfExpectedWarnings} MSBuild warnings for NativeAOT." - ); + var warningLine = b.LastBuildOutput.FirstOrDefault (x => x.Contains ("Warning(s)")); + Assert.IsNotNull (warningLine, $"{b.BuildLogFile} should contain a 'Warning(s)' summary line."); + var match = System.Text.RegularExpressions.Regex.Match (warningLine, @"(\d+)\s+Warning\(s\)"); + Assert.IsTrue (match.Success, $"Could not parse warning count from: {warningLine}"); + int actualWarnings = int.Parse (match.Groups [1].Value); + Assert.LessOrEqual (actualWarnings, maxExpectedWarnings, + $"{b.BuildLogFile} should have at most {maxExpectedWarnings} MSBuild warnings for NativeAOT, but found {actualWarnings}."); if (validateWarnings) { const string expectedWarningIL3050 = "ILC : AOT analysis warning IL3050:"; var warnings = b.LastBuildOutput.SkipWhile (x => !x.StartsWith ("Build succeeded.", StringComparison.Ordinal)).Where (x => x.Contains (expectedWarningIL3050, StringComparison.Ordinal)); - Assert.IsTrue (warnings.Count () == numberOfExpectedWarnings, $"Expected {numberOfExpectedWarnings} 'IL3050' warnings, found {warnings.Count ()}"); + Assert.LessOrEqual (warnings.Count (), maxExpectedWarnings, $"Expected at most {maxExpectedWarnings} 'IL3050' warnings, found {warnings.Count ()}"); } } else { From ac98a57f1c678cebfd1208c1e8d48ae52224932a Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Thu, 23 Apr 2026 15:39:14 -0700 Subject: [PATCH 06/10] Add _CreatePropertiesCache dependency for trimmable NativeAOT path The trimmable path skips _PrepareLinking (ILLink-specific), but _PrepareLinking indirectly triggered _CreatePropertiesCache which resolves AndroidBinUtilsDirectory via _ResolveSdks. Without this, CompileNativeAssembly fails in the inner per-RID build. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../targets/Microsoft.Android.Sdk.NativeAOT.targets | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.NativeAOT.targets b/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.NativeAOT.targets index ab812b48bc6..92beda2612e 100644 --- a/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.NativeAOT.targets +++ b/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.NativeAOT.targets @@ -68,6 +68,7 @@ This file contains the NativeAOT-specific MSBuild logic for .NET for Android. _AndroidComputeIlcCompileInputs; $(IlcCompileDependsOn) + <_AndroidBeforeIlcCompileDependsOn>_CreatePropertiesCache Date: Fri, 24 Apr 2026 11:12:51 -0700 Subject: [PATCH 07/10] Skip NativeAOT incremental build test pending #11210 NativeAOT + trimmable builds fail at Java compilation because JavaInteropRuntime.java and NativeAotEnvironmentVars.java are not generated by the trimmable typemap path. Tracked in #11210. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../TrimmableTypeMapBuildTests.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/TrimmableTypeMapBuildTests.cs b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/TrimmableTypeMapBuildTests.cs index d64e9f770fb..fcd91087799 100644 --- a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/TrimmableTypeMapBuildTests.cs +++ b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/TrimmableTypeMapBuildTests.cs @@ -49,6 +49,12 @@ public void Build_WithTrimmableTypeMap_IncrementalBuild ([Values] bool isRelease return; } + // https://github.com/dotnet/android/issues/11210 + if (runtime == AndroidRuntime.NativeAOT) { + Assert.Ignore ("NativeAOT trimmable build does not yet generate JavaInteropRuntime.java"); + return; + } + var proj = new XamarinAndroidApplicationProject { IsRelease = isRelease, }; From 7a26c6cd74c5a050ef58a7e66fc80f77c210fbc3 Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Fri, 24 Apr 2026 14:30:19 -0700 Subject: [PATCH 08/10] Revert "Update NativeAOT APK size baseline" This reverts commit b5eee264e2b7d80dc1676ebd705cee5f44c569ba. --- .../Base/BuildReleaseArm64SimpleDotNet.NativeAOT.apkdesc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Resources/Base/BuildReleaseArm64SimpleDotNet.NativeAOT.apkdesc b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Resources/Base/BuildReleaseArm64SimpleDotNet.NativeAOT.apkdesc index 77e8bab1a6b..75e2332c446 100644 --- a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Resources/Base/BuildReleaseArm64SimpleDotNet.NativeAOT.apkdesc +++ b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Resources/Base/BuildReleaseArm64SimpleDotNet.NativeAOT.apkdesc @@ -8,7 +8,7 @@ "Size": 25400 }, "lib/arm64-v8a/libUnnamedProject.so": { - "Size": 4601760 + "Size": 5072296 }, "META-INF/BNDLTOOL.RSA": { "Size": 1221 @@ -44,5 +44,5 @@ "Size": 1904 } }, - "PackageSize": 1962978 + "PackageSize": 2126818 } \ No newline at end of file From 1ab86558bb1ef24f5afae3633c12179845c94bf5 Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Fri, 24 Apr 2026 14:30:19 -0700 Subject: [PATCH 09/10] Revert "Update NativeAOT expected warning count to use <= 92" This reverts commit 71665b0b40c32cad100e835557a360773800024b. --- .../Xamarin.Android.Build.Tests/BuildTest2.cs | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildTest2.cs b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildTest2.cs index 741984287bc..759d6a2f855 100644 --- a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildTest2.cs +++ b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildTest2.cs @@ -478,33 +478,33 @@ public void BuildHasNoWarnings (bool isRelease, bool xamarinForms, bool multidex Assert.IsTrue (b.Build (proj), "Build should have succeeded."); if (runtime == AndroidRuntime.NativeAOT) { - int maxExpectedWarnings; + int numberOfExpectedWarnings; bool validateWarnings; if (xamarinForms && !multidex && packageFormat == "apk") { - // NativeAOT produces ILC warnings for AOT-incompatible patterns in XamarinForms. - maxExpectedWarnings = 92; + // NativeAOT goes nuts here (Nov 2025) with 120 different ILC warnings, too many to verify them here in a way that makes sense + numberOfExpectedWarnings = 120; validateWarnings = false; } else { // NativeAOT currently (Nov 2025) produces 6 `ILC : AOT analysis warning IL3050` warnings for various // bits of code. Even though this test expects no warnings and the above likely make the app not work // correctly at run time, it is still worth running this test under NativeAOT to test for the absence // of other warnings. - maxExpectedWarnings = 6; + numberOfExpectedWarnings = 6; validateWarnings = true; } - var warningLine = b.LastBuildOutput.FirstOrDefault (x => x.Contains ("Warning(s)")); - Assert.IsNotNull (warningLine, $"{b.BuildLogFile} should contain a 'Warning(s)' summary line."); - var match = System.Text.RegularExpressions.Regex.Match (warningLine, @"(\d+)\s+Warning\(s\)"); - Assert.IsTrue (match.Success, $"Could not parse warning count from: {warningLine}"); - int actualWarnings = int.Parse (match.Groups [1].Value); - Assert.LessOrEqual (actualWarnings, maxExpectedWarnings, - $"{b.BuildLogFile} should have at most {maxExpectedWarnings} MSBuild warnings for NativeAOT, but found {actualWarnings}."); + Assert.IsTrue ( + StringAssertEx.ContainsText ( + b.LastBuildOutput, + $" {numberOfExpectedWarnings} Warning(s)" + ), + $"{b.BuildLogFile} should have exactly {numberOfExpectedWarnings} MSBuild warnings for NativeAOT." + ); if (validateWarnings) { const string expectedWarningIL3050 = "ILC : AOT analysis warning IL3050:"; var warnings = b.LastBuildOutput.SkipWhile (x => !x.StartsWith ("Build succeeded.", StringComparison.Ordinal)).Where (x => x.Contains (expectedWarningIL3050, StringComparison.Ordinal)); - Assert.LessOrEqual (warnings.Count (), maxExpectedWarnings, $"Expected at most {maxExpectedWarnings} 'IL3050' warnings, found {warnings.Count ()}"); + Assert.IsTrue (warnings.Count () == numberOfExpectedWarnings, $"Expected {numberOfExpectedWarnings} 'IL3050' warnings, found {warnings.Count ()}"); } } else { From 9a6c30aaba288aff0fc71050d4e7d5a3292477eb Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Fri, 24 Apr 2026 14:30:40 -0700 Subject: [PATCH 10/10] Restore ILLink-path TrimmerRootAssembly rooting for ILC The ILLink path needs TrimmerRootAssembly TrimMode=All for all ILLink-trimmed assemblies so ILC doesn't trim further. Without it, ILC removes JNI callback types that are invoked from Java at runtime, causing MemberAccessException crashes. The trimmable path doesn't need this because it doesn't run ILLink and ILC handles all trimming directly. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../targets/Microsoft.Android.Sdk.NativeAOT.targets | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.NativeAOT.targets b/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.NativeAOT.targets index 92beda2612e..a356e2fe0a6 100644 --- a/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.NativeAOT.targets +++ b/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.NativeAOT.targets @@ -162,12 +162,14 @@ This file contains the NativeAOT-specific MSBuild logic for .NET for Android. <_IlcManagedInputAssemblies Remove="@(_IlcManagedInputAssemblies)" /> - + + <_AndroidILLinkAssemblies Include="@(ManagedAssemblyToLink->'$(IntermediateLinkDir)%(Filename)%(Extension)')" Condition="Exists('$(IntermediateLinkDir)%(Filename)%(Extension)')" /> +