Fix API 37 platform directory name: android-37 to android-37.0#11072
Draft
jonathanpeppers wants to merge 2 commits intomainfrom
Draft
Fix API 37 platform directory name: android-37 to android-37.0#11072jonathanpeppers wants to merge 2 commits intomainfrom
jonathanpeppers wants to merge 2 commits intomainfrom
Conversation
Google's SDK Manager installs API 37 to platforms/android-37.0 (matching the package name platform-37.0_r01), but our tooling was looking for platforms/android-37, causing XA5207 for customer projects. CI didn't catch this because xaprepare provisions the SDK platform using the apiLevel parameter (which was '37'), creating platforms/android-37 locally - matching what the tooling expected. Customers using sdkmanager get the correct android-37.0 directory name. Fix by changing platformID/apiLevel from '37' to '37.0' consistently: - BuildAndroidPlatforms.cs: platformID '37' → '37.0' - AndroidToolchain.cs: apiLevel '37' → '37.0' - Configuration.props: AndroidLatestUnstablePlatformId '37' → '37.0' - Rename api-37.xml → api-37.0.xml (and .params.txt) - Update merge-configuration.xml and metadata references - Update CI DefaultTestSdkPlatforms variable Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Member
Author
|
/azp run Xamarin.Android-PR |
|
No pipelines are associated with this pull request. |
jonathanpeppers
added a commit
to dotnet/android-tools
that referenced
this pull request
Apr 2, 2026
…320) Fixes: #319 Starting with API 37, Google's SDK Manager installs platform directories as `android-37.0` instead of `android-37`. Both `TryGetPlatformDirectoryFromApiLevel` and `IsPlatformInstalled` only tried `android-{major}`, so projects targeting these newer API levels would fail with **XA5207**. This adds a `.0` fallback to both methods: when the integer-only directory doesn't exist, also try `android-{id}.0`. This complements the data-side fix in dotnet/android#11072 (which sets the `Id` to `"37.0"` directly) by providing a safety net when the `Id` is just `"37"`. ### Changes - **`AndroidSdkInfo.TryGetPlatformDirectoryFromApiLevel`** — After existing lookups fail, try `GetPlatformDirectoryFromId(id + ".0")` when `id` is an integer. - **`AndroidSdkInfo.IsPlatformInstalled`** — Apply the same `.0` fallback so it stays consistent with `TryGetPlatformDirectoryFromApiLevel`. - **`AndroidSdkInfoTests`** — New test `TryGetPlatformDirectoryFromApiLevel_MajorFallsBackToMajorDotZero` creates only `android-37.0` and verifies both APIs find it. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…back Includes dotnet/android-tools#320 which adds a fallback in TryGetPlatformDirectoryFromApiLevel: when android-{id} doesn't exist and id is an integer, it also tries android-{id}.0. This fixes XA5207 for customers whose SDK Manager installs API 37 to platforms/android-37.0 instead of platforms/android-37. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Member
Author
|
/azp run Xamarin.Android-PR |
|
No pipelines are associated with this pull request. |
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.
Google's SDK Manager installs API 37 to
platforms/android-37.0(matching the package nameplatform-37.0_r01), but our tooling was looking forplatforms/android-37, causing XA5207 for customer projects.Root Cause
CI didn't catch this because xaprepare provisions the SDK platform using the
apiLevelparameter (which was37), creatingplatforms/android-37locally -- matching what the tooling expected. Customers usingsdkmanagerget the correctandroid-37.0directory name.Changes
BuildAndroidPlatforms.cs:platformID: '37'to'37.0'AndroidToolchain.cs:apiLevel: '37'to'37.0'Configuration.props:AndroidLatestUnstablePlatformId37to37.0api-37.xmltoapi-37.0.xmlandapi-37.params.txttoapi-37.0.params.txtmerge-configuration.xmlandmetadatareferencesDefaultTestSdkPlatformsvariable