Skip to content

Remove UseLatestAndroidPlatformSdk - #10839

Merged
jonathanpeppers merged 2 commits into
mainfrom
copilot/remove-use-latest-android-platform-sdk
Feb 19, 2026
Merged

Remove UseLatestAndroidPlatformSdk#10839
jonathanpeppers merged 2 commits into
mainfrom
copilot/remove-use-latest-android-platform-sdk

Conversation

Copilot AI commented Feb 19, 2026

Copy link
Copy Markdown
Contributor

Removes the legacy UseLatestAndroidPlatformSdk concept from Xamarin.Android. This property was a Xamarin.Android-era feature with no use in the .NET Android SDK — treating it as always false and inlining accordingly.

ResolveAndroidTooling.cs (Legacy task)

  • Removed UseLatestAndroidPlatformSdk property
  • Removed the "use latest installed SDK" branch from ValidateApiLevels() along with its priority-order comment
  • Removed GetMaxInstalledApiLevel() helper (only used by the removed branch)
  • ValidateApiLevels() now only resolves via $(TargetFrameworkVersion) or $(AndroidApiLevel); logs XA0000 if neither is set

ResolveSdksTaskTests.cs

  • Removed TargetFrameworkPairing test and data (relied entirely on UseLatestAndroidPlatformSdk = true)
  • Removed the 6 parameterized cases that set UseLatestAndroidPlatformSdk = true and the implicit-fallback case where neither TFV nor API level was provided
  • Renamed remaining test data/method: UseLatestAndroidSdkTestCasesResolveAndroidToolingTestCases, UseLatestAndroidSdkResolveAndroidToolingTest
  • Removed UseLatestAndroidPlatformSdk = false from ResolveSdkTiming

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: jonathanpeppers <840039+jonathanpeppers@users.noreply.github.com>
Copilot AI changed the title [WIP] Remove outdated UseLatestAndroidPlatformSdk references Remove UseLatestAndroidPlatformSdk Feb 19, 2026
@jonathanpeppers
jonathanpeppers marked this pull request as ready for review February 19, 2026 20:56
Copilot AI review requested due to automatic review settings February 19, 2026 20:56

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR removes the legacy UseLatestAndroidPlatformSdk property from Xamarin.Android, which was a Xamarin.Android-era feature that has no use in the modern .NET Android SDK. The change treats this property as if it were always false and simplifies the code accordingly.

Changes:

  • Removed UseLatestAndroidPlatformSdk property and its associated logic from ResolveAndroidTooling.cs
  • Simplified ValidateApiLevels() to only resolve via $(TargetFrameworkVersion) or $(AndroidApiLevel), logging XA0000 error if neither is set
  • Removed 7 test cases from ResolveSdksTaskTests.cs that relied on UseLatestAndroidPlatformSdk behavior and renamed test artifacts

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/Xamarin.Android.Build.Tasks/Tasks/Legacy/ResolveAndroidTooling.cs Removed UseLatestAndroidPlatformSdk property, GetMaxInstalledApiLevel() helper method, and simplified ValidateApiLevels() to only use TargetFrameworkVersion or AndroidApiLevel
src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/Tasks/ResolveSdksTaskTests.cs Removed TargetFrameworkPairing test and 6 parameterized test cases that used UseLatestAndroidPlatformSdk=true, renamed test data and method from UseLatestAndroidSdk* to ResolveAndroidTooling*

@jonathanpeppers jonathanpeppers left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only test failure is: Build_CSharp_Change

MAUI Integration Tests have an unrelated failure.

The updated tests look OK:

Image

@jonathanpeppers
jonathanpeppers merged commit 265a63b into main Feb 19, 2026
7 of 11 checks passed
@jonathanpeppers
jonathanpeppers deleted the copilot/remove-use-latest-android-platform-sdk branch February 19, 2026 21:59
@github-actions github-actions Bot locked and limited conversation to collaborators Mar 22, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants