uses-feature.version should be settable according to android documentation - #10890
Merged
Conversation
Happypig375
requested review from
grendello,
jonathanpeppers and
simonrozsival
as code owners
March 5, 2026 16:15
Contributor
There was a problem hiding this comment.
Pull request overview
Enables setting the Android manifest <uses-feature android:version="..."> attribute via Android.App.UsesFeatureAttribute, aligning with Android documentation (notably for Vulkan feature version requirements).
Changes:
- Make
UsesFeatureAttribute.Versionpublicly settable and wire it into the manifest mapping loader. - Update manifest-attribute-codegen metadata so
uses-feature.versionis generated as writable/visible.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/Mono.Android/Android.App/UsesFeatureAttribute.cs | Makes Version settable and adds a mapping setter so values specified in attributes are applied during manifest generation. |
| build-tools/manifest-attribute-codegen/metadata.xml | Changes metadata so uses-feature.version is no longer read-only (generated as writable). |
Comments suppressed due to low confidence (1)
src/Mono.Android/Android.App/UsesFeatureAttribute.cs:33
- Making
UsesFeatureAttribute.Versionsettable enablesandroid:versionemission, but manifest merging/deduplication currently treats<uses-feature>entries as unique only byNameorglEsVersion(seeManifestDocument.AddUsesFeatures). If an existing manifest already contains the sameandroid:name(or multiple assemblies specify it), the newversionvalue can be dropped, producing an incorrect manifest for Vulkan features. Consider updating the dedupe logic to also account forVersion(and likelyRequired) or to merge/replace existing entries whenversiondiffers.
public int Version { get; set; }
#if XABT_MANIFEST_EXTENSIONS
static Xamarin.Android.Manifest.ManifestDocumentElement<UsesFeatureAttribute> mapping = new ("uses-feature");
You can also share your feedback on Copilot code review. Take the survey.
jonathanpeppers
approved these changes
Mar 5, 2026
jonathanpeppers
left a comment
Member
There was a problem hiding this comment.
There are examples on GitHub that set version:
jonathanpeppers
enabled auto-merge (squash)
March 5, 2026 22:47
grendello
approved these changes
Mar 6, 2026
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.
https://developer.android.com/guide/topics/manifest/uses-feature-element#hw-features
versionis used for vulkan features. This attribute operates similarly toglEsVersionand therefore should be similarly settable.There is no other way to use this attribute property currently aside from reflection.