Skip to content

Conversation

@jonathanpeppers
Copy link
Member

Context: #10194
Context: https://discord.com/channels/732297728826277939/732297837953679412/1427681737957441577
Fixes: #6739

PR #10194 was originally meant to fix #6739, but did not when testing a sample project. The test written in #10194 passed even without the fixes, so we did not have a proper test case.

After reviewing the failing project, I noticed <Aapt2Link/> was passed:

AndroidManifestFile = D:\Downloads\test_sdk26\AndroidManifest.xml

This is the developer's AndroidManifest.xml in their project, which should completely omit <uses-sdk/> in favor of the $(SupportedOSPlatformVersion) MSBuild property. I suspect the fix for #10194 would have worked if <uses-sdk/> was present.

<Aapt2Link/> can run quite early, before we have generated the final AndroidManifest.xml file. So, a solution here is to pass in $(SupportedOSPlatformVersion) to <Aapt2Link/>.

I also updated the test so it properly tests this scenario.

Context: #10194
Context: https://discord.com/channels/732297728826277939/732297837953679412/1427681737957441577
Fixes: #6739

PR #10194 was originally meant to fix #6739, but did not when testing
a sample project. The test written in #10194 passed even without the
fixes, so we did not have a proper test case.

After reviewing the failing project, I noticed `<Aapt2Link/>` was passed:

    AndroidManifestFile = D:\Downloads\test_sdk26\AndroidManifest.xml

This is the developer's `AndroidManifest.xml` in their project, which
should completely omit `<uses-sdk/>` in favor of the
`$(SupportedOSPlatformVersion)` MSBuild property. I suspect the fix
for #10194 would have worked if `<uses-sdk/>` was present.

`<Aapt2Link/>` can run quite early, before we have generated the final
`AndroidManifest.xml` file. So, a solution here is to pass in
`$(SupportedOSPlatformVersion)` to `<Aapt2Link/>`.

I also updated the test so it properly tests this scenario.
@grendello
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@jonathanpeppers jonathanpeppers enabled auto-merge (squash) October 16, 2025 13:37
@jonathanpeppers jonathanpeppers merged commit 988c7ad into main Oct 16, 2025
60 checks passed
@jonathanpeppers jonathanpeppers deleted the dev/peppers/aapt2link-fix branch October 16, 2025 14:18
jonathanpeppers added a commit that referenced this pull request Oct 16, 2025
)

Context: #10194
Context: https://discord.com/channels/732297728826277939/732297837953679412/1427681737957441577
Fixes: #6739

PR #10194 was originally meant to fix #6739, but did not when testing
a sample project. The test written in #10194 passed even without the
fixes, so we did not have a proper test case.

After reviewing the failing project, I noticed `<Aapt2Link/>` was passed:

    AndroidManifestFile = D:\Downloads\test_sdk26\AndroidManifest.xml

This is the developer's `AndroidManifest.xml` in their project, which
should completely omit `<uses-sdk/>` in favor of the
`$(SupportedOSPlatformVersion)` MSBuild property. I suspect the fix
for #10194 would have worked if `<uses-sdk/>` was present.

`<Aapt2Link/>` can run quite early, before we have generated the final
`AndroidManifest.xml` file. So, a solution here is to pass in
`$(SupportedOSPlatformVersion)` to `<Aapt2Link/>`.

I also updated the test so it properly tests this scenario.
@github-actions github-actions bot locked and limited conversation to collaborators Nov 16, 2025
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.

Xamarin.Android .NET 6 not passing min SDK version to Aapt2Link

3 participants