Bug in iOS Reverse Geocoding? Calling ReverseGeoLocationAsync Hangs

AuriRahimzadehAuriRahimzadeh USMember ✭✭

I'm wondering if anyone else has this issue... Using the iOS 8.4 Simulator and latest Xamarin Forms as of today:

    public async Task<string> GetStreetAddress (double latitude, double longitude)
    {
        using (CLGeocoder gc = new CLGeocoder ()) {
            using (var location = new CLLocation (latitude, longitude)) {
                var address = String.Empty;

// gc.ReverseGeocodeLocation (location, (CLPlacemark[] locations, NSError error) => {
// if (locations != null && locations.Length != 0) {
// address = String.Format ("{0} {1}", locations [0].Name, locations [0].PostalCode);
// }
// });
var locations = await gc.ReverseGeocodeLocationAsync (location);
if (locations != null && locations.Length != 0) {
address = String.Format ("{0} {1}", locations [0].Name, locations [0].PostalCode);
}

                return address;
            }
        }
    }

The standard delegate approach works. However, calling gc.ReverseGeocodeLocationAsync simply hangs - execution just pauses. It appears an "Error 200" is occurring, but I don't know what that is in this case:

Resolved pending breakpoint at 'iOSGeoCoder.cs:26,1' to void CrimeWatch.iOS.iOSGeoCoder.c__async0.MoveNext () [0x00071].
Mono.Debugger.Soft.CommandException: Debuggee returned error code 200.
at Mono.Debugger.Soft.VirtualMachine.ErrorHandler (System.Object sender, Mono.Debugger.Soft.ErrorHandlerEventArgs args) [0x00076] in /Users/builder/data/lanes/1881/8010a90f/source/monodevelop/main/external/debugger-libs/Mono.Debugger.Soft/Mono.Debugger.Soft/VirtualMachine.cs:350
at Mono.Debugger.Soft.Connection.SendReceive (CommandSet command_set, Int32 command, Mono.Debugger.Soft.PacketWriter packet) [0x000f9] in /Users/builder/data/lanes/1881/8010a90f/source/monodevelop/main/external/debugger-libs/Mono.Debugger.Soft/Mono.Debugger.Soft/Connection.cs:1544
at Mono.Debugger.Soft.Connection.Type_GetCustomAttributes (Int64 id, Int64 attr_type_id, Boolean inherit) [0x00017] in /Users/builder/data/lanes/1881/8010a90f/source/monodevelop/main/external/debugger-libs/Mono.Debugger.Soft/Mono.Debugger.Soft/Connection.cs:2215
at Mono.Debugger.Soft.TypeMirror.AppendCustomAttrs (IList`1 attrs, Mono.Debugger.Soft.TypeMirror type, Boolean inherit) [0x00053] in /Users/builder/data/lanes/1881/8010a90f/source/monodevelop/main/external/debugger-libs/Mono.Debugger.Soft/Mono.Debugger.Soft/TypeMirror.cs:712
at Mono.Debugger.Soft.TypeMirror.GetCustomAttrs (Mono.Debugger.Soft.TypeMirror type, Boolean inherit) [0x0000b] in /Users/builder/data/lanes/1881/8010a90f/source/monodevelop/main/external/debugger-libs/Mono.Debugger.Soft/Mono.Debugger.Soft/TypeMirror.cs:727
at Mono.Debugger.Soft.TypeMirror.GetCustomAttributes (Boolean inherit) [0x00004] in /Users/builder/data/lanes/1881/8010a90f/source/monodevelop/main/external/debugger-libs/Mono.Debugger.Soft/Mono.Debugger.Soft/TypeMirror.cs:697
at Mono.Debugging.Soft.SoftDebuggerAdaptor.OnGetTypeDisplayData (Mono.Debugging.Evaluation.EvaluationContext ctx, System.Object type) [0x00018] in /Users/builder/data/lanes/1881/8010a90f/source/monodevelop/main/external/debugger-libs/Mono.Debugging.Soft/SoftDebuggerAdaptor.cs:1477

Has anyone else had this issue? I haven't had a chance to try on a "real" iOS device as of yet. However, knowing the "classic" method of doing such works tends to have me thinking this is a bug in the "new" Async approach that's been written.

Thanks,

-Auri

Answers

Sign In or Register to comment.