Bug 25974 - Method not found: 'CoreLocation.CLLocationManager.set_Delegate'.
Summary: Method not found: 'CoreLocation.CLLocationManager.set_Delegate'.
Status: RESOLVED FIXED
Alias: None
Product: Mobile API (Preview)
Classification: Xamarin
Component: Xamarin.iOS ()
Version: Preview 0.6.3
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: ---
Assignee: Bill Holmes
URL:
Depends on:
Blocks:
 
Reported: 2015-01-13 09:34 UTC by Sam Pollock
Modified: 2017-05-24 18:38 UTC (History)
4 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and 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 Links.

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.

Related Links:
Status:
RESOLVED FIXED

Description Sam Pollock 2015-01-13 09:34:29 UTC
I have recently upgraded my projects to unified api and both are hitting the following error when executed

Method not found: 'CoreLocation.CLLocationManager.set_Delegate'.

I am using the standard async call as shown below

var locator = new Geolocator { DesiredAccuracy = 50 };
//            new Geolocator (this) { ... }; on Android
locator.GetPositionAsync (timeout: 10000).ContinueWith (t => {
	Console.WriteLine ("Position Status: {0}", t.Result.Timestamp);
	Console.WriteLine ("Position Latitude: {0}", t.Result.Latitude);
	Console.WriteLine ("Position Longitude: {0}", t.Result.Longitude);
}, TaskScheduler.FromCurrentSynchronizationContext());
Comment 1 sco 2015-01-13 10:16:17 UTC
As discussed on the forum, same problem here. Binding problem in the Unified API, and it affects Xamarin.Mobile as well as every other way to get location manually via CLLocationManager :-(
Comment 2 Matthew Leibowitz 2017-05-24 18:38:01 UTC
As mentioned in the forums, it appears to have been a packaging bug.
https://forums.xamarin.com/discussion/30811/method-not-found-corelocation-cllocationmanager-set-delegate-using-xamarin-mobile

This should be working now.

I would also like to point out that the Mobile API is being deprecated in favor of various plugins (which have the equivalent/same API):
 - Contacts: https://www.nuget.org/packages/Xam.Plugin.Contacts
 - Geolocator: https://www.nuget.org/packages/Xam.Plugin.Geolocator
 - Media: https://www.nuget.org/packages/Xam.Plugin.Media

This plugin model has several advantages:
 - Each plugin is independent, and can be updated as such
 - It is no longer an all-or-nothing package
 - Plugins can be mixed/replaced with other plugins that offer similar features

Thanks for using the Mobile API, and we hope that the new plugin model will enable you to produce even better mobile apps.