Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report on
Developer Community or GitHub with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
I have an app that uses an extended version of the Xamarin.Forms.Maps mapview on iOS. Users on iOS 10 are crashing with the following exception when going to the map page:
System.InvalidCastExceptionSpecified cast is not valid.
iSurvey.iOS.ExtendedMapView_iOS.<OnElementPropertyChanged>m__0(MKMapView mapView, IMKAnnotation annotation)
<Module>.invoke_MKAnnotationView_MKMapView_IMKAnnotation(MKMapView, IMKAnnotation)(wrapper delegate-invoke)
MapKit.MKMapView._MKMapViewDelegate.GetViewForAnnotation(MKMapView mapView, IMKAnnotation annotation)
UIKit.UIApplication.UIApplicationMain(int, string, intptr, intptr)(wrapper managed-to-native)
UIKit.UIApplication.Main(string args, IntPtr principal, IntPtr delegate)
UIKit.UIApplication.Main(string args, string principalClassName, string delegateClassName)
It appears it is crashing when I try to cast the IMKAnnotation to my custom map annotation class (which extends the MKAnnotation class). This cast is working fine on all versions before iOS 10.
I have fixed this issue by using Runtime.GetNSObject() to get the native object before trying to cast to my custom map annotation.