Bug 4431 - Cannot link app because of unresolved LocationProvider::get_Accuracy()
Summary: Cannot link app because of unresolved LocationProvider::get_Accuracy()
Alias: None
Product: Android
Classification: Xamarin
Component: MSBuild ()
Version: 4.1.x
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Eric Maupin
Depends on:
Reported: 2012-04-13 18:06 UTC by honza.keller
Modified: 2012-07-07 14:19 UTC (History)
5 users (show)

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:

Description honza.keller 2012-04-13 18:06:35 UTC
If I set any kind of linking, the build process fails.

/Library/Frameworks/Mono.framework/External/xbuild/Novell/Novell.MonoDroid.Common.targets: Error: Error executing task LinkAssemblies: Failed to resolve System.Int32 Android.Locations.LocationProvider::get_Accuracy()
Comment 1 Atsushi Eno 2012-04-19 02:54:14 UTC
This does not fail to build for me. Could you provide a reproducible project?

Here is my repro code Activity1.cs that is the only difference from a new application project (I only replaced button.Click delegate content):

using System;

using Android.App;
using Android.Content;
using Android.Locations;
using Android.Runtime;
using Android.Views;
using Android.Widget;
using Android.OS;

namespace AndroidTest7
	[Activity (Label = "AndroidTest7", MainLauncher = true)]
	public class Activity1 : Activity
		protected override void OnCreate (Bundle bundle)
			base.OnCreate (bundle);

			// Set our view from the "main" layout resource
			SetContentView (Resource.Layout.Main);

			// Get our button from the layout resource,
			// and attach an event to it
			Button button = FindViewById<Button> (Resource.Id.myButton);
			button.Click += delegate {
				var lmgr = (LocationManager) this.GetSystemService (Context.LocationService);
				var provider = lmgr.GetProvider (lmgr.AllProviders [0]);
				Console.WriteLine (provider.Accuracy);
Comment 2 honza.keller 2012-04-19 03:43:13 UTC
Maybe I did not provide all the info. It happend only if I set traget framework to Android 4.0. With lower API level, there was no linking problem. I also did not use any LocationManager or any other Location services in my project.

I tried to compile it again after developing it with API Level 12 for few days and it works fine even with target set to Level 14. I really don't know what could I change to make a difference.

Your code also works fine with all target api.
Comment 3 Michal Dobrodenka 2012-04-19 14:51:22 UTC
I have project with xamarin.mobile, this happens to me on 4.1. Tested on 2.2.1 and 2.3.3 device.
Comment 4 Atsushi Eno 2012-04-23 01:51:26 UTC
I don't think we can do anything without reproducing sample. If any of you could create a repro, please attach it and reopen this bug. Thanks for the report anyways!
Comment 5 Jonathan Pryor 2012-04-24 10:11:42 UTC
You need a Xamarin.Mobile.dll that was built against Mono for Android 4.1 (due to enum-related breakage). We need to host a new Xamarin.Mobile.dll somewhere...

Eric? :-)
Comment 6 Eric Maupin 2012-04-24 13:35:15 UTC
The downloadable (available at http://xamarin.com/mobileapi ) for Xamarin.Mobile has been updated with a MfA 4.2 (which 4.1 is a preview of) build, this should resolve your issue.