Repository navigation
[tests] Restore previous Android SDK device coverage on .NET 12 - #13406
Merged
Merged
Conversation
Install and retain the previous Android SDK for local workload tests, use JDK 21 and supported runtime configurations, and verify managed activity startup without legacy Xamarin.Forms dependencies. Co-authored-by: Copilot App <[email protected]>
Remove generated MSBuild assertions and duplicate startup waits; keep the managed activity log check and shorten supporting documentation. Co-authored-by: Copilot App <[email protected]>
Contributor
There was a problem hiding this comment.
🔵 Needs a closer look
An offline emulator prevented validation of the restored cross-version installation and managed-activity launch tests across CoreCLR Debug/Release and NativeAOT Release.
No open issues 🎉
What changed in this PR
Restores previous-SDK device coverage on .NET 12 by testing net11.0-android applications, addressing #12879. Updates local workload provisioning to install and retain the previous Android SDK.
Changes:
- Re-enables CoreCLR Debug/Release and NativeAOT Release tests using a plain activity, the connected device’s ABI, and a managed startup log message.
- Shares JDK 21 discovery across tests and disables ReadyToRun for the previous-SDK test.
- Installs
Microsoft.Android.Sdk.net11after cleaning old packs and documents test prerequisites.
Reported build validation passed after generating required documentation files; device installation and launch remain unvalidated because the emulator could not start.
| File | Description |
|---|---|
| tests/MSBuildDeviceIntegration/Tests/InstallAndRunTests.cs | Restores previous-SDK runtime cases and managed startup verification. |
| src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/XASdkTests.cs | Removes the JDK helper now shared through BaseTest. |
| src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/Utilities/BaseTest.cs | Provides shared JDK 21 discovery. |
| build-tools/create-packs/ConfigureLocalWorkload.targets | Installs the previous Android SDK and moves cleanup before installation. |
| .github/skills/tests/references/test-catalog.md | Documents restored configurations and JDK requirements. |
Review effort: Balanced
simonrozsival
approved these changes
Nov 6, 2026
simonrozsival
deleted the
jonathanpeppers-previous-sdk-device-coverage
branch
November 6, 2026 11:37
This was referenced Nov 9, 2026
simonrozsival
added a commit
that referenced
this pull request
Nov 21, 2026
Context: #13613 A second, unchanged `make leeroy CONFIGURATION=Release` still redid work on every run: * The `GenerateWorkloadDependencies` target had no `Inputs`/`Outputs` and ran `dotnet run`, which re-evaluated, restored, and built `workload-dependencies.csproj` before regenerating `WorkloadDependencies.json` (~5-10 s per build). Build the generator with the `<MSBuild/>` task in the active configuration, run its DLL with `$(DotNetPreviewTool)`, and make the target incremental. The command-line arguments are written to a state file (`WriteOnlyWhenDifferent`) that is one of the target inputs, so property changes still regenerate. When the manifest feed is a remote URL, the state file is always rewritten, so the target always runs. `Microsoft.NET.Sdk.Android.proj` now forwards `$(DotNetPreviewTool)`. * `Xamarin.Android.Tools.Bytecode-Tests.targets` declared `classes/com/xamarin/module-info.class` as an output of the `BuildClasses` target, but `javac` writes module descriptors to the output root (`classes/module-info.class`). The missing output reran `javac` and the test project's C# compile on every build. * The `BuildExtraApiLevels` invocation in `BuildEverything.mk` restored `Microsoft.Android.slnx` again, although the preceding `leeroy` invocation just restored it. Pass `--no-restore`. * `eng/install-dotnet.sh` always ran `dotnet-install.sh`, which spends several seconds checking an SDK that is already installed. Exit early when `dotnet --list-sdks` already contains the exact pinned version. `DeleteExtractedWorkloadPacks` (from #13406) still deletes and reinstalls `Microsoft.Android.Sdk.Darwin` from the feed on every `ConfigureLocalWorkload` run. That is intentional, so it is not changed here. Validation on macOS arm64, Release, in a fresh worktree: * `make prepare CONFIGURATION=Release && make leeroy CONFIGURATION=Release`: succeeded. * A second `make leeroy CONFIGURATION=Release`: succeeded; `GenerateWorkloadDependencies` and `BuildClasses` were skipped as up to date. * `./dotnet-local.sh test tests/Xamarin.Android.Tools.Bytecode-Tests/Xamarin.Android.Tools.Bytecode-Tests.csproj -c Release`: 132 passed, 2 skipped. Co-authored-by: Copilot App <[email protected]>
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Re-enable
DotNetInstallAndRunPreviousSdknow that main targets .NET 12 and the previous target is .NET 11. Use a plain Android activity, JDK 21, the connected device's ABI, and the supported CoreCLR Debug/Release and NativeAOT Release configurations. Verify launch through a managed activity log message. Disable the previous workload's unsupported Android ReadyToRun path (#11719).Local workload setup also needs to install
Microsoft.Android.Sdk.net11and clean old packs before installation; otherwise a previous-framework app fails with NETSDK1147 despite successful setup.Fixes #12879
Validation
make prepare: passed.make allandmake leeroy: solution/test compilation passed, but workload setup failed on missingMono.Android.xml(an existing local-build prerequisite)../dotnet-local.sh build src/Mono.Android/Mono.Android.csproj -p:GenerateDocumentationFile=true -p:NoWarn=1591 -v:minimalandGenerateDocumentationFile=true ./dotnet-local.sh build Microsoft.Android.slnx -t:BuildExtraApiLevels -p:NoWarn=1591 -v:minimal: passed, generating the required XML../dotnet-local.sh build build-tools/create-packs/Microsoft.Android.Sdk.proj -t:ConfigureLocalWorkload -v:minimal: passed with the provisioning fix; the previous SDK remains installed.JAVA_HOME_21_ARM64=/Library/Java/JavaVirtualMachines/microsoft-21.jdk/Contents/Home ./dotnet-local.sh test bin/TestDebug/net11.0/Xamarin.Android.Build.Tests.dll --filter 'Name~MauiTargetFramework&Name~net11.0': passed, 2 tests, none skipped../dotnet-local.sh build tests/MSBuildDeviceIntegration/MSBuildDeviceIntegration.csproj --no-restore -v:minimal: passed../dotnet-local.sh test bin/TestDebug/MSBuildDeviceIntegration/net11.0/MSBuildDeviceIntegration.dll --list-tests: confirmed all three restored cases.net11.0-androidactivity built with the local .NET 12 SDK for CoreCLR Debug/Release and NativeAOT Release. CoreCLR builds had no warnings; NativeAOT emitted the expected XA1040. APK inspection confirmedlibcoreclr.sofor CoreCLR and the compiled app.sofor NativeAOT.Device installation/launch could not be validated: a dedicated API 36.1 arm64 emulator remained offline with
hvf is not enabled on this aarch64 hostandqemu_mprotect__osdep: mprotect failed: Permission denied, including a retry with explicit HVF acceleration. No shared adb server or emulator was stopped.