Repository navigation
[NativeAOT] Let the SDK select runtime packs - #12750
Merged
Merged
Conversation
The .NET SDK now advertises android-arm for NativeAOT runtime packs, so the Android-side KnownRuntimePack rewrite is no longer needed. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The workaround removal matches the updated SDK behavior and existing tests already validate android-arm NativeAOT runtime pack selection during restore.
Pull request overview
Removes the Android-side KnownRuntimePack metadata rewrite for Microsoft.NETCore.App NativeAOT runtime packs, now that the .NET SDK itself advertises android-arm and should provide the correct runtime pack version/RIDs.
Changes:
- Deleted the
KnownRuntimePackoverride that appendedandroid-armand forcedLatestRuntimeFrameworkVersion. - Leaves NativeAOT restore/runtime-pack selection to the pinned .NET SDK (per issue #12362).
File summaries
| File | Description |
|---|---|
| src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.NativeAOT.targets | Removes the KnownRuntimePack rewrite so restore/runtime-pack selection is SDK-driven. |
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 1
- Review effort level: Lite
Do not stamp MicrosoftNETCoreAppRefPackageVersion into the Android workload. Add restore coverage proving that NativeAOT runtime pack selection remains owned by the installed .NET SDK. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
5 tasks
Runtime packs are represented in project.assets.json as framework download dependencies, not library keys. Assert the selected versions from the correct section. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
simonrozsival
approved these changes
Sep 10, 2026
Member
|
Thanks! |
jonpryor
added a commit
to unoplatform/uno
that referenced
this pull request
Sep 11, 2026
Context: #22745 Context: dotnet/android#12750 Context: f42da04 Update version numbers accordingly. To sanity-check locally, try: \cp build/ci/net11/_global.json global.json dotnet build -f net11.0-ios26.5 src/Uno.Foundation/Uno.Foundation.netcoremobile.csproj dotnet build -f net11.0 src/Uno.UI/Uno.UI.csproj dotnet publish -f net11.0-android -p:UnoTargetFrameworkOverride=net11.0-android src/SamplesApp/SamplesApp/SamplesApp.csproj -p:UNO_DISABLE_ANALYZERS_IN_SAMPLES=true dotnet build -c Release -f net11.0-ios -p:UnoTargetFrameworkOverride=net11.0-ios src/SamplesApp/SamplesApp/SamplesApp.csproj Fix trimmer warning: * IL2080: src/Uno.UI/UI/Xaml/Documents/UnicodeText.ICU.cs(249,19): error IL2080: 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.NonPublicMethods' in call to 'System.Type.GetMethod(String, BindingFlags)'. The field '(System.String, System.Type).Item2' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to. which frankly feels like a bug in the trimmer; how did `ValueTuple<T1, T2>.Item2` get involved? Note: Android+NativeAOT *still* fails to build by default, due to a similar bug as in .NET 11 Preview 7; see also f42da04, e.g. Unable to find package Microsoft.NETCore.App.Runtime.NativeAOT.android-arm64 with version (= 11.0.0-rc.1.26428.117) - Found 23 version(s) in nuget.org [ Nearest version: 11.0.0-rc.1.26425.128 ] - Found 0 version(s) in /Users/jon/Downloads/dotnet-sdk-11.0.100-rc.1.26425.128/library-packs Update the workaround within `Uno.CrossTargetting.targets`, and cross fingers 🤞 that .NET 11 rc.2 doesn't require this workaround.
jonpryor
added a commit
to unoplatform/uno
that referenced
this pull request
Sep 14, 2026
Context: #22745 Context: dotnet/android#12750 Context: f42da04 Update version numbers accordingly. To sanity-check locally, try: \cp build/ci/net11/_global.json global.json dotnet build -f net11.0-ios26.5 src/Uno.Foundation/Uno.Foundation.netcoremobile.csproj dotnet build -f net11.0 src/Uno.UI/Uno.UI.csproj dotnet publish -f net11.0-android -p:UnoTargetFrameworkOverride=net11.0-android src/SamplesApp/SamplesApp/SamplesApp.csproj -p:UNO_DISABLE_ANALYZERS_IN_SAMPLES=true dotnet build -c Release -f net11.0-ios -p:UnoTargetFrameworkOverride=net11.0-ios src/SamplesApp/SamplesApp/SamplesApp.csproj Fix trimmer warning: * IL2080: src/Uno.UI/UI/Xaml/Documents/UnicodeText.ICU.cs(249,19): error IL2080: 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.NonPublicMethods' in call to 'System.Type.GetMethod(String, BindingFlags)'. The field '(System.String, System.Type).Item2' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to. which frankly feels like a bug in the trimmer; how did `ValueTuple<T1, T2>.Item2` get involved? Note: Android+NativeAOT *still* fails to build by default, due to a similar bug as in .NET 11 Preview 7; see also f42da04, e.g. Unable to find package Microsoft.NETCore.App.Runtime.NativeAOT.android-arm64 with version (= 11.0.0-rc.1.26428.117) - Found 23 version(s) in nuget.org [ Nearest version: 11.0.0-rc.1.26425.128 ] - Found 0 version(s) in /Users/jon/Downloads/dotnet-sdk-11.0.100-rc.1.26425.128/library-packs Update the workaround within `Uno.CrossTargetting.targets`, and cross fingers 🤞 that .NET 11 rc.2 doesn't require this workaround.
jonpryor
added a commit
to unoplatform/uno
that referenced
this pull request
Sep 14, 2026
Context: #22745 Context: dotnet/android#12750 Context: f42da04 Update version numbers accordingly. To sanity-check locally, try: \cp build/ci/net11/_global.json global.json dotnet build -f net11.0-ios26.5 src/Uno.Foundation/Uno.Foundation.netcoremobile.csproj dotnet build -f net11.0 src/Uno.UI/Uno.UI.csproj dotnet publish -f net11.0-android -p:UnoTargetFrameworkOverride=net11.0-android src/SamplesApp/SamplesApp/SamplesApp.csproj -p:UNO_DISABLE_ANALYZERS_IN_SAMPLES=true dotnet publish -f net11.0-android -p:UnoTargetFrameworkOverride=net11.0-android src/SamplesApp/SamplesApp/SamplesApp.csproj -p:ApplicationId=uno.platform.samplesapp.skia.nativeaot -p:SkiaPublishAot=true -p:SkiaSharpVersion=4.151.1 dotnet build -c Release -f net11.0-ios -p:UnoTargetFrameworkOverride=net11.0-ios src/SamplesApp/SamplesApp/SamplesApp.csproj Note: when updating `_Dotnet.cs`, the `version` value in `new PackageIdentity(id, version)` must match the *filesystem path* underneath `packs/Microsoft.NETCore.App.Ref`, and may *not* match the output of `dotnet --version`. Check the filesystem! Fix trimmer warning: * IL2080: src/Uno.UI/UI/Xaml/Documents/UnicodeText.ICU.cs(249,19): error IL2080: 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.NonPublicMethods' in call to 'System.Type.GetMethod(String, BindingFlags)'. The field '(System.String, System.Type).Item2' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to. which frankly feels like a bug in the trimmer; how did `ValueTuple<T1, T2>.Item2` get involved? Note: Android+NativeAOT *still* fails to build by default, due to a similar bug as in .NET 11 Preview 7; see also f42da04, e.g. Unable to find package Microsoft.NETCore.App.Runtime.NativeAOT.android-arm64 with version (= 11.0.0-rc.1.26428.117) - Found 23 version(s) in nuget.org [ Nearest version: 11.0.0-rc.1.26425.128 ] - Found 0 version(s) in /Users/jon/Downloads/dotnet-sdk-11.0.100-rc.1.26425.128/library-packs Update the workaround within `Uno.CrossTargetting.targets`, and cross fingers 🤞 that .NET 11 rc.2 doesn't require this workaround.
jonpryor
added a commit
to unoplatform/uno
that referenced
this pull request
Sep 14, 2026
Context: #22745 Context: dotnet/android#12750 Context: dotnet/runtime#133911 Context: f42da04 Update version numbers accordingly. To sanity-check locally, try: \cp build/ci/net11/_global.json global.json dotnet build -f net11.0-ios26.5 src/Uno.Foundation/Uno.Foundation.netcoremobile.csproj dotnet build -f net11.0 src/Uno.UI/Uno.UI.csproj dotnet publish -f net11.0-android -p:UnoTargetFrameworkOverride=net11.0-android src/SamplesApp/SamplesApp/SamplesApp.csproj -p:UNO_DISABLE_ANALYZERS_IN_SAMPLES=true dotnet publish -f net11.0-android -p:UnoTargetFrameworkOverride=net11.0-android src/SamplesApp/SamplesApp/SamplesApp.csproj -p:ApplicationId=uno.platform.samplesapp.skia.nativeaot -p:SkiaPublishAot=true -p:SkiaSharpVersion=4.151.1 dotnet build -c Release -f net11.0-ios -p:UnoTargetFrameworkOverride=net11.0-ios src/SamplesApp/SamplesApp/SamplesApp.csproj Note: when updating `_Dotnet.cs`, the `version` value in `new PackageIdentity(id, version)` must match the *filesystem path* underneath `packs/Microsoft.NETCore.App.Ref`, which *may not* match the output of `dotnet --version`. Check the filesystem! Address an IL2080 trimmer warning: // 249: var (methodName, type) = OperatingSystem.IsBrowser() ? ($"uno_{typeof(T).Name}", typeof(BrowserICUSymbols)) : ($"{typeof(T).Name}_{_icuVersion}", typeof(IOSICUSymbols)) src/Uno.UI/UI/Xaml/Documents/UnicodeText.ICU.cs(249,19): error IL2080: 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.NonPublicMethods' in call to 'System.Type.GetMethod(String, BindingFlags)'. The field '(System.String, System.Type).Item2' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to. Filed dotnet/runtime#133911 for the above warning, as it feels wrong. Note: Android+NativeAOT *still* fails to build by default, due to a similar bug as in .NET 11 Preview 7; see also f42da04, e.g. Unable to find package Microsoft.NETCore.App.Runtime.NativeAOT.android-arm64 with version (= 11.0.0-rc.1.26428.117) - Found 23 version(s) in nuget.org [ Nearest version: 11.0.0-rc.1.26425.128 ] - Found 0 version(s) in /Users/jon/Downloads/dotnet-sdk-11.0.100-rc.1.26425.128/library-packs Update the workaround within `Uno.CrossTargetting.targets`, and cross fingers 🤞 that .NET 11 rc.2 doesn't require this workaround. Update `android-run-skia-runtime-tests.sh` to capture a screenshot of the device screen as the tests are run, so we can see what is shown when Android tests hang.
jonpryor
added a commit
to unoplatform/uno
that referenced
this pull request
Sep 15, 2026
Context: #22745 Context: dotnet/android#12750 Context: dotnet/runtime#133911 Context: f42da04 Update version numbers accordingly. To sanity-check locally, try: \cp build/ci/net11/_global.json global.json dotnet build -f net11.0-ios26.5 src/Uno.Foundation/Uno.Foundation.netcoremobile.csproj dotnet build -f net11.0 src/Uno.UI/Uno.UI.csproj dotnet publish -f net11.0-android -p:UnoTargetFrameworkOverride=net11.0-android src/SamplesApp/SamplesApp/SamplesApp.csproj -p:UNO_DISABLE_ANALYZERS_IN_SAMPLES=true dotnet publish -f net11.0-android -p:UnoTargetFrameworkOverride=net11.0-android src/SamplesApp/SamplesApp/SamplesApp.csproj -p:ApplicationId=uno.platform.samplesapp.skia.nativeaot -p:SkiaPublishAot=true -p:SkiaSharpVersion=4.151.1 dotnet build -c Release -f net11.0-ios -p:UnoTargetFrameworkOverride=net11.0-ios src/SamplesApp/SamplesApp/SamplesApp.csproj Note: when updating `_Dotnet.cs`, the `version` value in `new PackageIdentity(id, version)` must match the *filesystem path* underneath `packs/Microsoft.NETCore.App.Ref`, which *may not* match the output of `dotnet --version`. Check the filesystem! Address an IL2080 trimmer warning: // 249: var (methodName, type) = OperatingSystem.IsBrowser() ? ($"uno_{typeof(T).Name}", typeof(BrowserICUSymbols)) : ($"{typeof(T).Name}_{_icuVersion}", typeof(IOSICUSymbols)) src/Uno.UI/UI/Xaml/Documents/UnicodeText.ICU.cs(249,19): error IL2080: 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.NonPublicMethods' in call to 'System.Type.GetMethod(String, BindingFlags)'. The field '(System.String, System.Type).Item2' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to. Filed dotnet/runtime#133911 for the above warning, as it feels wrong. Note: Android+NativeAOT *still* fails to build by default, due to a similar bug as in .NET 11 Preview 7; see also f42da04, e.g. Unable to find package Microsoft.NETCore.App.Runtime.NativeAOT.android-arm64 with version (= 11.0.0-rc.1.26428.117) - Found 23 version(s) in nuget.org [ Nearest version: 11.0.0-rc.1.26425.128 ] - Found 0 version(s) in /Users/jon/Downloads/dotnet-sdk-11.0.100-rc.1.26425.128/library-packs Update the workaround within `Uno.CrossTargetting.targets`, and cross fingers 🤞 that .NET 11 rc.2 doesn't require this workaround. Update `android-run-skia-runtime-tests.sh` to capture a screenshot of the device screen as the tests are run, so we can see what is shown when Android tests hang.
jonpryor
added a commit
to unoplatform/uno
that referenced
this pull request
Sep 15, 2026
Context: #22745 Context: dotnet/android#12750 Context: dotnet/runtime#133911 Context: f42da04 Update version numbers accordingly. To sanity-check locally, try: \cp build/ci/net11/_global.json global.json dotnet build -f net11.0-ios26.5 src/Uno.Foundation/Uno.Foundation.netcoremobile.csproj dotnet build -f net11.0 src/Uno.UI/Uno.UI.csproj dotnet publish -f net11.0-android -p:UnoTargetFrameworkOverride=net11.0-android src/SamplesApp/SamplesApp/SamplesApp.csproj -p:UNO_DISABLE_ANALYZERS_IN_SAMPLES=true dotnet publish -f net11.0-android -p:UnoTargetFrameworkOverride=net11.0-android src/SamplesApp/SamplesApp/SamplesApp.csproj -p:ApplicationId=uno.platform.samplesapp.skia.nativeaot -p:SkiaPublishAot=true -p:SkiaSharpVersion=4.151.1 dotnet build -c Release -f net11.0-ios -p:UnoTargetFrameworkOverride=net11.0-ios src/SamplesApp/SamplesApp/SamplesApp.csproj Note: when updating `_Dotnet.cs`, the `version` value in `new PackageIdentity(id, version)` must match the *filesystem path* underneath `packs/Microsoft.NETCore.App.Ref`, which *may not* match the output of `dotnet --version`. Check the filesystem! Address an IL2080 trimmer warning: // 249: var (methodName, type) = OperatingSystem.IsBrowser() ? ($"uno_{typeof(T).Name}", typeof(BrowserICUSymbols)) : ($"{typeof(T).Name}_{_icuVersion}", typeof(IOSICUSymbols)) src/Uno.UI/UI/Xaml/Documents/UnicodeText.ICU.cs(249,19): error IL2080: 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.NonPublicMethods' in call to 'System.Type.GetMethod(String, BindingFlags)'. The field '(System.String, System.Type).Item2' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to. Filed dotnet/runtime#133911 for the above warning, as it feels wrong. Note: Android+NativeAOT *still* fails to build by default, due to a similar bug as in .NET 11 Preview 7; see also f42da04, e.g. Unable to find package Microsoft.NETCore.App.Runtime.NativeAOT.android-arm64 with version (= 11.0.0-rc.1.26428.117) - Found 23 version(s) in nuget.org [ Nearest version: 11.0.0-rc.1.26425.128 ] - Found 0 version(s) in /Users/jon/Downloads/dotnet-sdk-11.0.100-rc.1.26425.128/library-packs Update the workaround within `Uno.CrossTargetting.targets`, and cross fingers 🤞 that .NET 11 rc.2 doesn't require this workaround. Update `android-run-skia-runtime-tests.sh` to capture a screenshot of the device screen as the tests are run, so we can see what is shown when Android tests hang. Finally, update `android-run-skia-runtime-tests.sh` and `android-uitest-run.sh` to *stop* installing the `tools` package. Attempting to install it is now an error: % ($ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --sdk_root=/tmp/my-sdk --install 'tools') ; echo exit=$? Warning: Failed to find package 'tools' [=== ] 10% Computing updates... exit=1 (The `tools` package was last updated in *2017-September*, has been deprecarted for quite some time, and is now no longer mentioned in [`repository2-3.xml`][0], which lists all Android SDK packages. This removal has been a long time coming…) [0]: https://dl.google.com/android/repository/repository2-3.xml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Android RC1 workload stamped its build-time
MicrosoftNETCoreAppRefPackageVersioninto customer projects and used it to rewrite the .NET SDK's NativeAOTKnownRuntimePackmetadata. When the workload was built against11.0.0-rc.1.26428.117but installed with the11.0.100-rc.1.26425.128SDK,dotnet publish -p:PublishAot=truerequested runtime-pack versions that were not available on NuGet.org.KnownRuntimePackrewrite now that the .NET SDK advertisesandroid-armitself.MicrosoftNETCoreAppRefPackageVersionfrom the Android workload's bundled-version targets.This keeps runtime-pack and ILCompiler selection owned by the installed .NET SDK and avoids mismatches between independently built SDK and Android workload releases.
Fixes #12362