xamarin/Xamarin.Forms

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

Aperta

#5929 aperta il 16 apr 2019

 (3 commenti) (0 reazioni) (0 assegnatari)C# (1926 fork)batch import
a/maps :globe_with_meridians:e/2 :clock2:good first issuehelp wantedi/highinactivep/UWPt/bug :bug:up-for-grabs

Metriche repository

Star
 (5644 stelle)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

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

Guida contributor