xamarin/Xamarin.Forms

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

開放

#5,929 建立於 2019年4月16日

 (3 則留言) (0 個反應) (0 位負責人)C# (1,926 個分叉)batch import
a/maps :globe_with_meridians:e/2 :clock2:good first issuehelp wantedi/highinactivep/UWPt/bug :bug:up-for-grabs

倉庫指標

星標
 (5,644 顆星)
PR 合併指標
 (PR 指標待抓取)

描述

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

貢獻者指南