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

[.NET 10] invent a "recommended min OS version" for 24 #9527

Open
jonathanpeppers opened this issue Nov 19, 2024 · 2 comments
Open

[.NET 10] invent a "recommended min OS version" for 24 #9527

jonathanpeppers opened this issue Nov 19, 2024 · 2 comments
Assignees
Labels
Area: App+Library Build Issues when building Library projects or Application projects.
Milestone

Comments

@jonathanpeppers
Copy link
Member

jonathanpeppers commented Nov 19, 2024

Android framework version

net9.0-android

Affected platform version

any

Description

We would like to bump the minimum Android OS version to 24 (instead of 21), but we need to do it in a non-disruptive way.

I propose something like:

  • SupportedOSPlatformVersion=24 in project templates
  • If blank, SupportedOSPlatformVersion=24 is the default
  • Customers can opt into lower SupportedOSPlatformVersion=21, for example
  • We emit a build warning for SupportedOSPlatformVersion < 24

Steps to Reproduce

Ideally, it would:

  1. dotnet new android
  2. dotnet build
  3. I see minSdkVersion="24" in the resulting .apk

Did you find any workaround?

Set SupportedOSPlatformVersion=24 manually.

@jonathanpeppers jonathanpeppers added the Area: App+Library Build Issues when building Library projects or Application projects. label Nov 19, 2024
@jonathanpeppers jonathanpeppers added this to the .NET 10 milestone Nov 19, 2024
@dotnet-policy-service dotnet-policy-service bot added the needs-triage Issues that need to be assigned. label Nov 19, 2024
@rolfbjarne
Copy link
Member

There's some work towards changing the default SupportedOSPlatformVersion to the minimum valid value across all of .NET - if that could be tweaked a little bit to say the default SupportedOSPlatformVersion is a recommended value each individual SDK sets, then that could work for this:

  • Introduce a new RecommendedSupportedOSPlatformVersion property, which Android could set to 24 (for iOS we could set it to the minimum we support, unless we have a reason to do otherwise).
  • If RecommendedSupportedOSPlatformVersion is not set, then .NET keeps the same behavior as today (or change the default to the minimum, either way would work).

There are a couple of advantages:

  • No hardcoding values in the user's csproj, which will eventually end up invalid one day.
  • Telemetry is actually useful: if an app has SupportedOSPlatformVersion=21, we'll know it's on purpose, and not by accident.

CC @Redth

@Redth
Copy link
Member

Redth commented Nov 19, 2024

This seems like a good approach to me. It may also help with Windows' concern over changing implicit behaviour / current defaults. I could see us setting this value in the MAUI SDK for Windows if they were willing to add logic to check for the value and use it if no other explicit value is specified already.

@jpobst jpobst removed the needs-triage Issues that need to be assigned. label Nov 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: App+Library Build Issues when building Library projects or Application projects.
Projects
None yet
Development

No branches or pull requests

5 participants