xamarin/Xamarin.Forms

[Bug] UWP app crash when starting in airplane mode with a map control

Open

#5,929 opened on Apr 16, 2019

View on GitHub
 (3 comments) (0 reactions) (0 assignees)C# (5,644 stars) (1,926 forks)batch import
a/maps :globe_with_meridians:e/2 :clock2:good first issuehelp wantedi/highinactivep/UWPt/bug :bug:up-for-grabs

Description

Description

A UWP app started in airplane mode crashes if a map control is present.

Steps to Reproduce

  1. Find a UWP project having a map control with IsShowingUser="True"
  2. Build it and run it while online. See that it works.
  3. Turn airplane mode on and run it again. See that it crashes.

Expected Behavior

No crash

Actual Behavior

Crash with unhandled exception in the UWP map renderer: EXCEPTION:

System.Exception : Exception from HRESULT: 0x80072EE7   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Xamarin.Forms.Maps.UWP.MapRenderer.<UpdateIsShowingUser>d__11.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Xamarin.Forms.Maps.UWP.MapRenderer.<OnElementChanged>d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.<>c.<ThrowAsync>b__6_0(Object state)
   at System.Threading.WinRTSynchronizationContextBase.Invoker.InvokeCore()

Basic Information

  • Version with issue: Exists in 3.6.0.293080
  • Last known good version: Not sure
  • IDE: Visual Studio
  • Platform Target Frameworks:
    • UWP: 16299

Reproduction Link

https://github.com/xamarin/xamarin-forms-samples/tree/master/WorkingWithMaps

The HRESULT error code is explained here, having to do with server name resolution: https://ru.stackoverflow.com/a/915097

Contributor guide

[Bug] UWP app crash when starting in airplane mode with a map control · xamarin/Xamarin.Forms#5929 | Good First Issue