dotnet / android

.NET for Android provides open-source bindings of the Android SDK for use with .NET managed languages such as C#
MIT License
1.93k stars 532 forks source link

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

Open jonathanpeppers opened 2 days ago

jonathanpeppers commented 2 days ago

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:

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.

rolfbjarne commented 2 days ago

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:

There are a couple of advantages:

CC @Redth

Redth commented 2 days ago

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.