Skip to content

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

@jpobst

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.

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