Skip to content

Conversation

@dellis1972
Copy link
Contributor

@dellis1972 dellis1972 commented Mar 7, 2023

Fixes https://i.azdo.io/1720987

When users add an empty uses-sdk element to their AndroidManifest.xml file they can introduce the following error.

Error	AMM0000	
uses-sdk:minSdkVersion 19 cannot be smaller than version 21 declared in library C:…\obj\Debug\net7.0-android\lp\130\jl\AndroidManifest.xml as the library might be using APIs not available in 19
Suggestion: use a compatible library with a minSdk of at most 19,
or increase this project’s minSdk version to at least 21,
or use tools:overrideLibrary=“androidx.security” to force usage (may lead to runtime failures)
Directory ‘obj\Debug\net7.0-android\lp\130’ is from ‘androidx.security.security-crypto.aar’.

This is because the minSdk of libaries was not taken into consideration when genereting the final manifest file.
Currently if the user does NOT specify a minSdk in the manifest it will default to XABuildConfig.NDKMinimumApiAvailable which is currently set to 19. This then causes the conflict.

What we should do is figure out what the minSdk value is from any library projects and then use that if the user does
not provide one.

@dellis1972 dellis1972 changed the title ] [Xamarin.Android.Build.Tasks] honour minSdkVersion from library uses-sdk Manifest Files. Mar 7, 2023
@dellis1972 dellis1972 force-pushed the WI1720987 branch 4 times, most recently from 2456b55 to 9bbc232 Compare March 14, 2023 10:24
@dellis1972 dellis1972 closed this Apr 4, 2025
@dellis1972 dellis1972 deleted the WI1720987 branch April 4, 2025 07:56
@github-actions github-actions bot locked and limited conversation to collaborators May 4, 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.

1 participant