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

Xamarin developers get warnings when they call APIs that aren't available on the OS version they target #45193

Closed
2 of 3 tasks
terrajobst opened this issue Nov 25, 2020 · 9 comments
Assignees
Labels
area-Meta os-android os-ios Apple iOS Priority:0 Work that we can't release without User Story A single user-facing feature. Can be grouped under an epic.
Milestone

Comments

@terrajobst
Copy link
Member

terrajobst commented Nov 25, 2020

We already have the analyzer, but this work captures ensuring the Xamarin bindings for Apple & Android platform are using the platform compatibility annotations (as opposed to ones specific to the bindings).

https://github.com/dotnet/designs/blob/main/accepted/2020/platform-checks/platform-checks.md#attributes

Work Items

@Dotnet-GitSync-Bot Dotnet-GitSync-Bot added the untriaged New issue has not been triaged by the area owner label Nov 25, 2020
@terrajobst terrajobst added area-Meta User Story A single user-facing feature. Can be grouped under an epic. and removed untriaged New issue has not been triaged by the area owner labels Nov 25, 2020
@dotnet dotnet deleted a comment from Dotnet-GitSync-Bot Nov 25, 2020
@marek-safar marek-safar changed the title As a Xamarin developer, I get warnings when I call APIs that aren't available on the OS version I want to run on Xamarin developers get warnings when they call APIs that aren't available on the OS version they target Nov 27, 2020
@jeffhandley jeffhandley added the Priority:0 Work that we can't release without label Dec 17, 2020
@joperezr joperezr added this to the 6.0.0 milestone Feb 9, 2021
@dotMorten
Copy link

dotMorten commented Jun 29, 2021

Is this the reason I'm seeing all these (invalid) warnings when targeting net6.0-ios13 ?

warning CA1416: This call site is reachable on: 'iOS' 13.0 and later. 'CLLocationManager.StopUpdatingHeading()' is only supported on: 'macOS/OSX' 11.0 and later.
warning CA1416: This call site is reachable on: 'iOS' 13.0 and later. 'CLLocationManager.RequestWhenInUseAuthorization()' is only supported on: 'macOS/OSX' 11.0 and later.
warning CA1416: This call site is reachable on: 'iOS' 13.0 and later. 'CLLocationManager.StartUpdatingHeading()' is only supported on: 'macOS/OSX' 11.0 and later.
warning CA1416: This call site is reachable on: 'iOS' 13.0 and later. 'UIApplication.StatusBarOrientation.get' is unsupported on: 'ios' 9.0 and later.
warning CA1416: This call site is reachable on: 'iOS' 13.0 and later. 'UIApplication.StatusBarOrientation' is unsupported on: 'ios' 9.0 and later, 'macOS/OSX' 10.14 and later, 'maccatalyst' 13.1 and later.
warning CA1416: This call site is reachable on: 'iOS' 13.0 and later. 'CLLocationManager.AuthorizationStatus.get' is only supported on: 'macOS/OSX' 11.0 and later, 'tvos' 14.0 and later, 'ios' 14.0 and later, 'maccatalyst' 14.0 and later.
warning CA1416: This call site is reachable on: 'iOS' 13.0 and later. 'CLLocationManager.AuthorizationStatus' is only supported on: 'macOS/OSX' 11.0 and later, 'tvos' 14.0 and later, 'ios' 14.0 and later, 'maccatalyst' 14.0 and later.
warning CA1416: This call site is reachable on: 'iOS' 13.0 and later. 'CLLocationManager.Status.get' is unsupported on: 'ios' 14.0 and later.
warning CA1416: This call site is reachable on: 'iOS' 13.0 and later. 'CLLocationManager.Status' is unsupported on: 'ios' 14.0 and later.
warning CA1416: This call site is reachable on: 'iOS' 13.0 and later. 'CLFloor.Level' is only supported on: 'macOS/OSX' 10.15 and later.
warning CA1416: This call site is reachable on: 'iOS' 13.0 and later. 'CLLocation.Floor.get' is only supported on: 'macOS/OSX' 10.15 and later.
warning CA1416: This call site is reachable on: 'iOS' 13.0 and later. 'CLLocation.Floor' is only supported on: 'macOS/OSX' 10.15 and later.
warning CA1416: This call site is reachable on: 'iOS' 13.0 and later. 'CLLocation.Course' is only supported on: 'tvos' 13.0 and later.
warning CA1416: This call site is reachable on: 'iOS' 13.0 and later. 'CLLocation.Course.get' is only supported on: 'tvos' 13.0 and later.
warning CA1416: This call site is reachable on: 'iOS' 13.0 and later. 'CLFloor.Level' is only supported on: 'macOS/OSX' 10.15 and later.
warning CA1416: This call site is reachable on: 'iOS' 13.0 and later. 'CLLocation.Floor.get' is only supported on: 'macOS/OSX' 10.15 and later.
warning CA1416: This call site is reachable on: 'iOS' 13.0 and later. 'CLLocation.Floor' is only supported on: 'macOS/OSX' 10.15 and later.
warning CA1416: This call site is reachable on: 'iOS' 13.0 and later. 'CLLocation.Speed.get' is only supported on: 'tvos' 13.0 and later.
warning CA1416: This call site is reachable on: 'iOS' 13.0 and later. 'CLLocation.Speed' is only supported on: 'tvos' 13.0 and later.
warning CA1416: This call site is reachable on: 'iOS' 13.0 and later. 'CLLocation.Course' is only supported on: 'tvos' 13.0 and later.
warning CA1416: This call site is reachable on: 'iOS' 13.0 and later. 'CLLocation.Course.get' is only supported on: 'tvos' 13.0 and later.
warning CA1416: This call site is reachable on: 'iOS' 13.0 and later. 'CLLocation.Speed' is only supported on: 'tvos' 13.0 and later.
warning CA1416: This call site is reachable on: 'iOS' 13.0 and later. 'CLLocation.Speed.get' is only supported on: 'tvos' 13.0 and later.
warning CA1416: This call site is reachable on: 'iOS' 13.0 and later. 'CLLocationManager.HeadingAvailable.get' is only supported on: 'macOS/OSX' 11.0 and later.
warning CA1416: This call site is reachable on: 'iOS' 13.0 and later. 'CLLocationManager.HeadingAvailable' is only supported on: 'macOS/OSX' 11.0 and later.

@jeffhandley
Copy link
Member

Is this the reason I'm seeing all these (invalid) warnings when targeting net6.0-ios13 ?

This does look related. @dotMorten, if this is still happening with Preview 7, could you please file a fresh issue for those invalid diagnostics? Please tag @steveisok, @buyaa-n, and me in the issue. Thanks for the help!

@dotMorten
Copy link

@jeffhandley Thanks! I literally just got to upgrade and noticed warnings were still there, so wanted to go find this issue so I could comment that it hasn't be solved. Thanks for the notification so I didn't have to go search for it :)

image

@dotMorten
Copy link

@jeffhandley btw why a fresh issue? Isn't this issue here still valid?

@jeffhandley
Copy link
Member

We have this issue set up as a 'User Story', which is more of a tracking type issue as opposed to a bug report. By filing a fresh issue, it'll show up as a bug and go through our triage process properly and show up on our radar more effectively.

Thanks for checking against Preview 7!

@buyaa-n
Copy link
Contributor

buyaa-n commented Aug 12, 2021

Is this the reason I'm seeing all these (invalid) warnings when targeting net6.0-ios13 ?

@dotMorten why and which one do you think is invalid? Looks all valid to me

@dotMorten
Copy link

@buyaa-n CLLocation APIs are supported on iOS since more or less forever.

@buyaa-n
Copy link
Contributor

buyaa-n commented Aug 12, 2021

CLLocation APIs are supported on iOS since more or less forever.

Then that API need to be annotated with SupportedOSPlatform("ios[optional_version]"), i guess there is a warning because it is only annotated with SupportedOSPlatform("macOS[optional_version]") or so. But I cannot find such API in runtime, so i could not see the exact cause, also as the API is not in runtime please file an issue in the repo wherever the API defined

@ghost
Copy link

ghost commented Aug 17, 2021

Tagging subscribers to 'arch-android': @steveisok, @akoeplinger
See info in area-owners.md if you want to be subscribed.

Issue Details

We already have the analyzer, but this work captures ensuring the Xamarin bindings for Apple & Android platform are using the platform compatibility annotations (as opposed to ones specific to the bindings).

https://github.com/dotnet/designs/blob/main/accepted/2020/platform-checks/platform-checks.md#attributes

Work Items

Author: terrajobst
Assignees: marek-safar
Labels:

area-Meta, os-android, os-ios, User Story, Priority:0

Milestone: 6.0.0

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-Meta os-android os-ios Apple iOS Priority:0 Work that we can't release without User Story A single user-facing feature. Can be grouped under an epic.
Projects
No open projects
Development

No branches or pull requests

7 participants