Repository navigation
Remove NativeAOT runtime-pack override after dotnet/sdk#55750 ships #12362
Description
Activity
- addedneeds-triageIssues that need to be assigned.Issues that need to be assigned.and removedneeds-triageIssues that need to be assigned.Issues that need to be assigned.
on Aug 12, 2026 - addedneeds-triageIssues that need to be assigned.Issues that need to be assigned.
on Aug 12, 2026 - addedArea: App+Library BuildIssues when building Library projects or Application projects.Issues when building Library projects or Application projects.and removedneeds-triageIssues that need to be assigned.Issues that need to be assigned.
on Aug 12, 2026 @jonathanpeppers I think there's an issue with this in Dotnet 11 - Preview 7. I've likely misunderstood something, but I had to change this property in Microsoft.Android.Sdk.BundledVersions.targets to avoid errors referencing what looks like it must be an internal build (11.0.0-preview.7.26378.119?).
<MicrosoftNETCoreAppRefPackageVersion>11.0.0-preview.7.26381.103</MicrosoftNETCoreAppRefPackageVersion>I had been getting these errors:
error NU1102: Unable to find package Microsoft.NETCore.App.Runtime.NativeAOT.android-arm64 with version (= 11.0.0-preview.7.26378.119) error NU1102: - Found 21 version(s) in nuget.org [ Nearest version: 11.0.0-preview.7.26381.103 ] error NU1102: - Found 0 version(s) in /usr/share/dotnet/library-packs error NU1102: Unable to find package runtime.linux-x64.Microsoft.DotNet.ILCompiler with version (= 11.0.0-preview.7.26378.119) error NU1102: - Found 124 version(s) in nuget.org [ Nearest version: 11.0.0-preview.7.26381.103 ] error NU1102: - Found 0 version(s) in /usr/share/dotnet/library-packsThat got my NativeAOT Android build further - but I'm still hitting issues that look like its not finding the NDK correctly.
20:07:28 /usr/share/dotnet/packs/Microsoft.Android.Sdk.Linux/37.0.0-preview.7.2131/targets/Microsoft.Android.Sdk.NativeAOT.targets(352,5): error XA3007: Could not link native shared library: libXXXXXX.so 20:07:28 /usr/share/dotnet/packs/Microsoft.Android.Sdk.Linux/37.0.0-preview.7.2131/targets/Microsoft.Android.Sdk.NativeAOT.targets(352,5): error XA3007: 20:07:28 /usr/share/dotnet/packs/Microsoft.Android.Sdk.Linux/37.0.0-preview.7.2131/targets/Microsoft.Android.Sdk.NativeAOT.targets(352,5): error XA3007: stderr | ld: error: cannot open /crtbegin_so.o: No such file or directory 20:07:28 /usr/share/dotnet/packs/Microsoft.Android.Sdk.Linux/37.0.0-preview.7.2131/targets/Microsoft.Android.Sdk.NativeAOT.targets(352,5): error XA3007: stderr | ld: error: cannot open libc++_static.a: No such file or directory 20:07:28 /usr/share/dotnet/packs/Microsoft.Android.Sdk.Linux/37.0.0-preview.7.2131/targets/Microsoft.Android.Sdk.NativeAOT.targets(352,5): error XA3007: stderr | ld: error: cannot open libc++abi.a: No such file or directory 20:07:28 /usr/share/dotnet/packs/Microsoft.Android.Sdk.Linux/37.0.0-preview.7.2131/targets/Microsoft.Android.Sdk.NativeAOT.targets(352,5): error XA3007: stderr | ld: error: unable to find library -ldl 20:07:28 /usr/share/dotnet/packs/Microsoft.Android.Sdk.Linux/37.0.0-preview.7.2131/targets/Microsoft.Android.Sdk.NativeAOT.targets(352,5): error XA3007: stderr | ld: error: unable to find library -lz 20:07:28 /usr/share/dotnet/packs/Microsoft.Android.Sdk.Linux/37.0.0-preview.7.2131/targets/Microsoft.Android.Sdk.NativeAOT.targets(352,5): error XA3007: stderr | ld: error: unable to find library -llog 20:07:28 /usr/share/dotnet/packs/Microsoft.Android.Sdk.Linux/37.0.0-preview.7.2131/targets/Microsoft.Android.Sdk.NativeAOT.targets(352,5): error XA3007: stderr | ld: error: unable to find library -lm 20:07:28 /usr/share/dotnet/packs/Microsoft.Android.Sdk.Linux/37.0.0-preview.7.2131/targets/Microsoft.Android.Sdk.NativeAOT.targets(352,5): error XA3007: stderr | ld: error: unable to find library -lc 20:07:28 /usr/share/dotnet/packs/Microsoft.Android.Sdk.Linux/37.0.0-preview.7.2131/targets/Microsoft.Android.Sdk.NativeAOT.targets(352,5): error XA3007: stderr | ld: error: cannot open /libclang_rt.builtins-aarch64-android.a: No such file or directory 20:07:28 /usr/share/dotnet/packs/Microsoft.Android.Sdk.Linux/37.0.0-preview.7.2131/targets/Microsoft.Android.Sdk.NativeAOT.targets(352,5): error XA3007: stderr | ld: error: cannot open /libunwind.a: No such file or directory 20:07:28 /usr/share/dotnet/packs/Microsoft.Android.Sdk.Linux/37.0.0-preview.7.2131/targets/Microsoft.Android.Sdk.NativeAOT.targets(352,5): error XA3007: stderr | ld: error: cannot open /crtend_so.o: No such file or directory 20:07:28 /usr/share/dotnet/packs/Microsoft.Android.Sdk.Linux/37.0.0-preview.7.2131/targets/Microsoft.Android.Sdk.NativeAOT.targets(352,5): error XA3007:Yeah you'll need to change the property to get the correct version. The error about NDK is something else, I think you'll need to collect a binlog to see why the NDK isn't found.
@jonathanpeppers I think this should also be using DotNetRuntimePacksVersion in
android/src/workloads/workloads.csproj
Lines 40 to 43 in d57b8c4
<!-- NativeAOT Android runtime packs --> <PackageDownload Include="Microsoft.NETCore.App.Runtime.NativeAOT.android-arm" Version="[$(MicrosoftNETCoreAppRefPackageVersion)]" /> <PackageDownload Include="Microsoft.NETCore.App.Runtime.NativeAOT.android-arm64" Version="[$(MicrosoftNETCoreAppRefPackageVersion)]" /> <PackageDownload Include="Microsoft.NETCore.App.Runtime.NativeAOT.android-x64" Version="[$(MicrosoftNETCoreAppRefPackageVersion)]" /> That said DotNetRuntimePacksVersion is already set to MicrosoftNETCoreAppRefPackageVersion but I'm not sure that's what you want since it'd mean you need to sync exactly to the version that is being released? or is that workloads.csproj just being used inside of the android repo for tests?
Yeah you'll need to change the property to get the correct version. The error about NDK is something else, I think you'll need to collect a binlog to see why the NDK isn't found.
@jonathanpeppers I think this should also be using DotNetRuntimePacksVersion in
android/src/workloads/workloads.csproj
Lines 40 to 43 in d57b8c4
<!-- NativeAOT Android runtime packs --> <PackageDownload Include="Microsoft.NETCore.App.Runtime.NativeAOT.android-arm" Version="[$(MicrosoftNETCoreAppRefPackageVersion)]" /> <PackageDownload Include="Microsoft.NETCore.App.Runtime.NativeAOT.android-arm64" Version="[$(MicrosoftNETCoreAppRefPackageVersion)]" /> <PackageDownload Include="Microsoft.NETCore.App.Runtime.NativeAOT.android-x64" Version="[$(MicrosoftNETCoreAppRefPackageVersion)]" /> That said DotNetRuntimePacksVersion is already set to MicrosoftNETCoreAppRefPackageVersion but I'm not sure that's what you want since it'd mean you need to sync exactly to the version that is being released? or is that workloads.csproj just being used inside of the android repo for tests?
Our behavior also looked wrong here:
dotnet/sdk#55750 was merged. Yet .NET 11 RC 1 still shipped with workload packs that reference non-existing package versions and thus make NativeAOT publish unusable.
Current workaround:
<!-- Restore SDK-selected NativeAOT packs until dotnet/android#12362 is fixed. The RC 1 SDK already includes android-arm; the workload override pins an unpublished runtime version. --> <Target Name="RestoreSdkNativeAotRuntimePacks" BeforeTargets="ProcessFrameworkReferences" Condition="'$(PublishAot)' == 'true' and '@(_AndroidNetCoreAppNativeAotKnownRuntimePack)' != ''"> <ItemGroup> <KnownRuntimePack Remove="@(KnownRuntimePack->WithMetadataValue('Identity', 'Microsoft.NETCore.App')->WithMetadataValue('RuntimePackLabels', 'NativeAOT'))" /> <KnownRuntimePack Include="@(_AndroidNetCoreAppNativeAotKnownRuntimePack)" /> </ItemGroup> </Target>
I don't think we could fix this until RC 2 code flow came in. But I think we can fix now, I'm checking on it.
- added a commit that references this issue
on Sep 11, 2026 - locked and limited conversation to collaborators
on Oct 11, 2026
Android framework version
net11.0-android (Preview)
Affected platform version
.NET 11 SDK containing dotnet/sdk#55750
Description
Microsoft.Android.Sdk.NativeAOT.targetscurrently rewrites the .NET SDK'sKnownRuntimePackmetadata forMicrosoft.NETCore.AppNativeAOT packs. It pinsLatestRuntimeFrameworkVersionand appendsandroid-armtoRuntimePackRuntimeIdentifiers.This was added as an Android-side workaround because the .NET SDK did not advertise
android-armfor the NativeAOT runtime pack. dotnet/sdk#55750 adds that RID to the SDK's built-inKnownRuntimePackmetadata.Once dotnet/sdk#55750 is merged and available in the SDK used by this repository, remove the workaround from
src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.NativeAOT.targets:Context: #12356 (comment)
Steps to Reproduce
KnownRuntimePackoverride above.RuntimeIdentifiers=android-arm.project.assets.jsonselectsMicrosoft.NETCore.App.Runtime.NativeAOT.android-armand does not fall back toMicrosoft.NETCore.App.Runtime.NativeAOT.linux-bionic-arm.Did you find any workaround?
Keep the existing Android-side override until the updated SDK is available.
Relevant log output
N/A