Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[templates] Default $(SupportedOSPlatformVersion) to 24. #9656

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jpobst
Copy link
Contributor

@jpobst jpobst commented Jan 7, 2025

Fixes: #9517
Context: dotnet/android-libraries#767
Context: dotnet/android-libraries#767 (comment)

For .NET 10, update the dotnet new android template so that $(SupportedOSPlatformVersion) is 24, bumping from the current default of 21.

The reason for this is that "desugaring" "moves" Java methods to locations that we don't expect, which can result in AbstractMethodErrors at runtime. Setting the minimum SDK version to >= 24 avoids this desugaring step, preventing the Java methods from being moved in a manner we don't expect, and thus avoiding the AbstractMethodError.

Note that 21 will still be the supported minimum for those that need it, however this will keep most users who do not need to support devices that old from having desugaring issues.

@jpobst
Copy link
Contributor Author

jpobst commented Jan 8, 2025

This "fixes" the issue going forward. Should we also add a warning when $(SupportedOSPlatformVersion) < 24 to encourage users to update their existing projects?

Edit: I guess this is part of the #9527 proposal.

@jpobst jpobst changed the title [templates] Default $(SupportedOSPlatformVersion) to `24. [templates] Default $(SupportedOSPlatformVersion) to 24. Jan 8, 2025
@jpobst jpobst marked this pull request as ready for review January 8, 2025 17:54
@jpobst jpobst requested a review from jonpryor as a code owner January 8, 2025 17:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Set $(SupportedOSPlatformVersion)=24 in Android template
1 participant