# Xamarin Forms: iOS is failing in getting Geolocation

**URL:** <https://community.dynatrace.com/t/xamarin-forms-ios-is-failing-in-getting-geolocation/38305>\
**Category:** Real User Monitoring\
**Tags:** mobile-monitoring, dynatrace-api\
**Created:** [February 7, 2023, 6:41am UTC](https://community.dynatrace.com/t/xamarin-forms-ios-is-failing-in-getting-geolocation/38305 "2023-02-07T06:41:01Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![uca12496](https://avatars.discourse-cdn.com/v4/letter/u/bcef8e/32.png) [@uca12496](https://community.dynatrace.com/u/uca12496)\
**Post date:** [February 7, 2023, 6:41am UTC](https://community.dynatrace.com/t/xamarin-forms-ios-is-failing-in-getting-geolocation/38305/1 "2023-02-07T06:41:01Z")

</div>

I am getting exception in calling location api:

var request = new GeolocationRequest(GeolocationAccuracy.Medium, new TimeSpan(0, 0, 3));  
**var Loc = await Geolocation.GetLocationAsync(request);**

bold line is getting exception

Cannot get the method descriptor for the selector ‘locationManager\_DTX:didUpdateLocations:’ on the type ‘Xamarin.Essentials.SingleLocationListener’, because the selector does not correspond to a method

 ![Screen Shot 2023-02-07 at 10.22.07 AM (1).png](https://global.discourse-cdn.com/dynatrace/original/2X/5/5ab45ca9d16aa24fb47e0782e964e48df1d54dad.jpeg)

---

<div class="post-metadata">

**Author:** ![uca12496](https://avatars.discourse-cdn.com/v4/letter/u/bcef8e/32.png) [@uca12496](https://community.dynatrace.com/u/uca12496)\
**Post date:** [February 7, 2023, 11:21am UTC](https://community.dynatrace.com/t/xamarin-forms-ios-is-failing-in-getting-geolocation/38305/2 "2023-02-07T11:21:51Z")

</div>

I got answer from support team. We need to configure below variable in config file

**“DTXInstrumentGPSLocation” : false**

Thanks

---

<div class="post-metadata">

**Author:** ![Patrick\_H](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/patrick_h/32/37540_2.png) [@Patrick\_H](https://community.dynatrace.com/u/Patrick_H)\
**Post date:** [February 7, 2023, 2:31pm UTC](https://community.dynatrace.com/t/xamarin-forms-ios-is-failing-in-getting-geolocation/38305/3 "2023-02-07T14:31:02Z")

</div>

This just removes the symptom, so it is only a partial solution for the case where no location capturing is desired.  
If accurate location capturing is desired this would need more investigation.

---

<div class="post-metadata">

**Author:** ![Patrick\_H](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/patrick_h/32/37540_2.png) [@Patrick\_H](https://community.dynatrace.com/u/Patrick_H)\
**Post date:** [February 16, 2023, 7:14am UTC](https://community.dynatrace.com/t/xamarin-forms-ios-is-failing-in-getting-geolocation/38305/4 "2023-02-16T07:14:11Z")

</div>

our investigations showed that this seems to be a Problem with the Xamarin Simulator on ARM based Macs - the simulator still runs as x86 under rosetta and handling our instrumentation somehow causes troubles there. This does not happen on a device.
