Skip to content

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

Description

@jonathanpeppers

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.

Activity

  1. added this to the .NET 10 milestone on Nov 19, 2024
  2. rolfbjarne commented on Nov 19, 2024

    @rolfbjarne
    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

  3. Redth commented on Nov 19, 2024

    @Redth
    Member

    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.

  4. AraHaan commented on Jan 18, 2025

    @AraHaan
    Member

    I think it should instead do 23 as unity itself requires 23 and so doing 23 instead of 24 as minimum will give unity more motivation to instead ship as a shared framework instead on top of the existing .NET runtime (and not have it use it's own copy of the normal runtime anymore). The way the current unity works is a disaster so having it as 23 is a good first step to allow unity to do the best change moving forward.

  5. jonathanpeppers commented on Jan 18, 2025

    @jonathanpeppers
    MemberAuthor

    Are you talking about Unity3D or something else? I’m not aware of Unity3D being able to use .NET for Android, it doesn’t hook into MSBuild the same way as regular .NET projects, so I don’t see how it would work today.

  6. added theissue type on Apr 3, 2025
  7. jonathanpeppers commented on Aug 12, 2026

    @jonathanpeppers
    MemberAuthor

    CoreCLR already has a minimum of API 24 in .NET 11, we can close this now.

  8. locked and limited conversation to collaborators on Sep 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Area: App+Library BuildIssues when building Library projects or Application projects.enhancementProposed change to current functionality.

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions