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 合并指标
 (30 天内没有已合并 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

贡献者指南