Skip to content

Fix [SupportedOSPlatform] warnings in Mono.Android.dll #7590

Description

@jpobst

The .NET builds of Mono.Android.dll contain ~3K warnings apiece for [SupportedOSPlatform] issues:

/Users/runner/work/1/s/xamarin-android/src/Mono.Android/Android.App/ActionBar.cs(28,7): warning CA1416: This call site is reachable on: 'Android' 21.0 and later. 'ActionBar.Tab.SetTabListener(ActionBar.ITabListener?)' is only supported on: . [/Users/runner/work/1/s/xamarin-android/src/Mono.Android/Mono.Android.csproj::TargetFramework=net8.0]
/Users/runner/work/1/s/xamarin-android/src/Mono.Android/Android.App/ActionBar.cs(28,7): warning CA1422: This call site is reachable on: 'Android' 21.0 and later. 'ActionBar.Tab.SetTabListener(ActionBar.ITabListener?)' is obsoleted on: 'Android' 29.0 and later. [/Users/runner/work/1/s/xamarin-android/src/Mono.Android/Mono.Android.csproj::TargetFramework=net8.0]

We need to investigate these and see:

  • In generated code, do we have the data to emit proper attributes
  • In manual binding code, can we add the appropriate attributes
  • CA1416: ... is only supported on: . seems a little fishy, are we doing something incorrectly

This will likely be a long term project done over the course of the .NET 8 timeframe.

However, outputting all these warnings are currently slowing down our builds, so we should suppress them for now with <NoWarn>. This issue is a reminder that we need to investigate this further and try for a better fix.

Activity

  1. added this to the .NET 8 milestone on Nov 29, 2022
  2. self-assigned this
    on Nov 29, 2022
  3. ghost added
    needs-triageIssues that need to be assigned.
    on Nov 29, 2022
  4. reopened this on Nov 30, 2022
  5. grendello commented on Nov 30, 2022

    @grendello
    Contributor

    Context: 7004467

  6. locked and limited conversation to collaborators on Jan 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Area: Mono.AndroidIssues with the Android API binding (Mono.Android.dll).

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions