You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Xamarin developers get warnings when they call APIs that aren't available on the OS version they target #45193
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).
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[/+]on Nov 27, 2020
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.
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!
@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 :)
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.
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
Activity
[-]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[/+]dotMorten commentedon Jun 29, 2021
Is this the reason I'm seeing all these (invalid) warnings when targeting
net6.0-ios13?jeffhandley commentedon Aug 11, 2021
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 commentedon Aug 11, 2021
@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 :)
dotMorten commentedon Aug 11, 2021
@jeffhandley btw why a fresh issue? Isn't this issue here still valid?
jeffhandley commentedon Aug 11, 2021
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 commentedon Aug 12, 2021
@dotMorten why and which one do you think is invalid? Looks all valid to me
dotMorten commentedon Aug 12, 2021
@buyaa-n CLLocation APIs are supported on iOS since more or less forever.
buyaa-n commentedon Aug 12, 2021
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