Fix API 37 platform directory name: android-37 to android-37.0#11072
Open
jonathanpeppers wants to merge 2 commits intomainfrom
Open
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. |
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the repo’s “API 37 preview” identifiers from 37 to 37.0 where they’re used to form Android SDK platform directory/file names, aligning with how sdkmanager installs the platform (platforms/android-37.0) and preventing XA5207 caused by looking for platforms/android-37.
Changes:
- Update xaprepare’s Android platform provisioning to install/use
android-37.0instead ofandroid-37. - Update build configuration/CI variables to treat the latest unstable platform id as
37.0. - Rename/update API merge and metadata references to
api-37.0.*artifacts.
Reviewed changes
Copilot reviewed 7 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/Mono.Android/metadata | Updates merge-source matching rules from api-37.xml.in to api-37.0.xml.in. |
| Configuration.props | Sets AndroidLatestUnstablePlatformId default to 37.0 so generated/pipeline tooling uses the correct platform id. |
| build-tools/xaprepare/xaprepare/ConfigAndData/Dependencies/AndroidToolchain.cs | Provisions platform component into platforms/android-37.0 via apiLevel: "37.0". |
| build-tools/xaprepare/xaprepare/ConfigAndData/BuildAndroidPlatforms.cs | Changes platformID for API 37 preview to 37.0 to keep generated outputs consistent. |
| build-tools/automation/yaml-templates/variables.yaml | Updates CI-installed SDK platforms list to include 37.0. |
| build-tools/api-merge/merge-configuration.xml | Updates merge input/output file names from api-37.* to api-37.0.*. |
Member
Author
|
/azp run Xamarin.Android-PR |
|
No pipelines are associated with this pull request. |
This was referenced Apr 3, 2026
PureWeen
added a commit
to dotnet/maui
that referenced
this pull request
Apr 3, 2026
Backport of #34805 to preview3. ## Problem CI macOS builds fail with: ``` XA5207: Could not find android.jar for API level 36.1 Expected: /Users/builder/Library/Developer/Xamarin/android-sdk-macosx/platforms/android-36.1/android.jar ``` `AndroidTargetFrameworkVersion` was bumped to `36.1` but the provisioning list only had `android-36`. When CI runs with `onlyAndroidPlatformDefaultApis: true`, only the `IsDefault` item gets installed via `dotnet android sdk install --package "platforms;android-36.1"`. ## Fix - Keep `android-36` in the list (without `IsDefault`) - Add `android-36.1` with `IsDefault=True` so CI installs it - Add `android-37` for forward-compat (without `IsDefault`) ## Related - #34805 — net11.0 target - dotnet/android#11072 — same class of issue for API 37 - dotnet/android#10536 — non-integer API level support fixes Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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