Add UseMonoRuntime condition to API levels 21, 22, 23 in SupportedPlatforms generator#10753
Merged
jonathanpeppers merged 3 commits intomainfrom Feb 3, 2026
Merged
Conversation
…tforms generator Co-authored-by: jonathanpeppers <840039+jonathanpeppers@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add conditional supported platform versions for Mono runtime
Add UseMonoRuntime condition to API levels 21 and 22 in SupportedPlatforms generator
Feb 2, 2026
grendello
approved these changes
Feb 3, 2026
jonathanpeppers
approved these changes
Feb 3, 2026
simonrozsival
pushed a commit
that referenced
this pull request
Feb 5, 2026
…0753) API levels 21, 22, 23 are only supported by the Mono runtime, not CoreCLR/NativeAOT. The `<GenerateSupportedPlatforms/>` MSBuild task needs to emit these with a `$(UseMonoRuntime)` condition. ### Changes - **Configuration.props**: Add `AndroidMinimumNonMonoApiLevel` property (24) defining the minimum API level for non-Mono runtimes - **GenerateSupportedPlatforms.cs**: Add `MinimumNonMonoApiLevel` parameter; versions below this threshold get a `Condition` attribute - **Xamarin.Android.Build.Tasks.targets**: Pass the new parameter to the task ### Generated Output ```xml <AndroidSdkSupportedTargetPlatformVersion Include="21.0" DefineConstantsOnly="true" Condition=" '$(UseMonoRuntime)' == 'true' " /> <AndroidSdkSupportedTargetPlatformVersion Include="22.0" DefineConstantsOnly="true" Condition=" '$(UseMonoRuntime)' == 'true' " /> <AndroidSdkSupportedTargetPlatformVersion Include="23.0" DefineConstantsOnly="true" Condition=" '$(UseMonoRuntime)' == 'true' " /> <AndroidSdkSupportedTargetPlatformVersion Include="24.0" DefineConstantsOnly="true" /> <!-- ... --> ``` Co-authored-by: Jonathan Peppers <jonathan.peppers@microsoft.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 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.
API levels 21, 22, 23 are only supported by the Mono runtime, not CoreCLR/NativeAOT. The
GenerateSupportedPlatformstask needs to emit these with a$(UseMonoRuntime)condition.Changes
AndroidMinimumNonMonoApiLevelproperty (23) defining the minimum API level for non-Mono runtimesMinimumNonMonoApiLevelparameter; versions below this threshold get aConditionattributeGenerated Output
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.