【问题标题】:Can't launch an Android Emulator for Visual Studio无法为 Visual Studio 启动 Android 模拟器
【发布时间】:2017-01-18 17:13:41
【问题描述】:

从字面上尝试通过 Microsoft 论坛中提供的几个修复程序来解决此问题,但没有任何效果,我不明白一些事情。

我正在尝试启动测试 Xamarin 代码并使其在 Android 配置文件上运行,但是当我尝试安装时,它停留在复制 .vhd 文件并创建虚拟机。 Here.

然后它提示我输入管理员并重试。它失败并给我这个日志文件:

0> 9/9/2016 10:11:43 PM : [Informational] ===== Session Started =====
1> 9/9/2016 10:11:43 PM : [Informational] Emulator manager version: 1.1.622.2
1> 9/9/2016 10:11:43 PM : [Informational] Emulator manager plugin version: 1.1.622.2
1> 9/9/2016 10:11:43 PM : [Informational] Microsoft Windows NT 10.0.14393.0 Windows 10 Pro
1> 9/9/2016 10:11:43 PM : [Informational] Virtualization type: UnknownOrNotVirtual
1> 9/9/2016 10:11:43 PM : [Informational] Virtualization Version: alaska - 1072009
1> 9/9/2016 10:11:43 PM : [Informational] Virtualization Serial Number: to be filled by o.e.m.
1> 9/9/2016 10:11:43 PM : [Informational] Virtualization Product: z97 killer
1> 9/9/2016 10:11:43 PM : [Informational] Display Adapter 0: Name: NVIDIA GeForce GTX 970, Version: 21.21.13.7270
2> 9/9/2016 10:11:43 PM : [Informational] Reinitializing installed profiles.
2> 9/9/2016 10:11:43 PM : [Informational] Installed profiles initialized. Devices: 1 Platforms: 2
2> 9/9/2016 10:11:43 PM : [Informational] Reinitializing installable profiles.
2> 9/9/2016 10:11:45 PM : [Informational] Installable profiles initialized. Devices: 38 Platforms: 5
3> 9/9/2016 10:12:06 PM : [Informational] Waiting to uninstall device...
3> 9/9/2016 10:12:06 PM : [Informational] Uninstalling Device: 10.1" Marshmallow (6.0.0) XHDPI Tablet
3> 9/9/2016 10:12:06 PM : [Informational] Uninstalling virtual machine for 10.1" Marshmallow (6.0.0) XHDPI Tablet
3> 9/9/2016 10:12:06 PM : [Informational] Removing device files
3> 9/9/2016 10:12:06 PM : [Informational] Uninstall complete
2> 9/9/2016 10:12:06 PM : [Informational] Reinitializing installed profiles.
2> 9/9/2016 10:12:06 PM : [Informational] Installed profiles initialized. Devices: 0 Platforms: 2
4> 9/9/2016 10:12:08 PM : [Informational] Waiting to install device...
4> 9/9/2016 10:12:08 PM : [Informational] Installing Device: 5.7" Marshmallow (6.0.0) XHDPI Phone , Version: 1.0.60404.1
4> 9/9/2016 10:12:09 PM : [Informational] Creating device configuration
2> 9/9/2016 10:12:09 PM : [Informational] Reinitializing installed profiles.
2> 9/9/2016 10:12:09 PM : [Informational] Installed profiles initialized. Devices: 1 Platforms: 2
4> 9/9/2016 10:12:10 PM : [Informational] Copying .vhd files and creating virtual machine
4> 9/9/2016 10:14:12 PM : [Informational] Waiting to uninstall device...
4> 9/9/2016 10:14:12 PM : [Informational] Uninstalling Device: 5.7" Marshmallow (6.0.0) XHDPI Phone
4> 9/9/2016 10:14:12 PM : [Informational] Uninstalling virtual machine for 5.7" Marshmallow (6.0.0) XHDPI Phone
4> 9/9/2016 10:14:13 PM : [Informational] Removing device files
4> 9/9/2016 10:14:13 PM : [Informational] Uninstall complete
2> 9/9/2016 10:14:13 PM : [Informational] Reinitializing installed profiles.
2> 9/9/2016 10:14:13 PM : [Informational] Installed profiles initialized. Devices: 0 Platforms: 2
4> 9/9/2016 10:14:14 PM : [Informational] Waiting to install device...
4> 9/9/2016 10:14:14 PM : [Informational] Installing Device: 5.7" Marshmallow (6.0.0) XHDPI Phone , Version: 1.0.60404.1
4> 9/9/2016 10:14:14 PM : [Informational] Creating device configuration
2> 9/9/2016 10:14:14 PM : [Informational] Reinitializing installed profiles.
2> 9/9/2016 10:14:14 PM : [Informational] Installed profiles initialized. Devices: 1 Platforms: 2
4> 9/9/2016 10:14:15 PM : [Informational] Copying .vhd files and creating virtual machine
4> 9/9/2016 10:15:27 PM : [Critical] An internal virtual network switch is required for emulated devices to run.
4> 9/9/2016 10:15:27 PM : [Critical] XDE Path: C:\Program Files (x86)\Microsoft XDE\10.0.10586.0\xde.exe
4> 9/9/2016 10:15:27 PM : [Critical] XDE Arguments: /sku Android /displayName "VS Emulator 5.7\" Marshmallow (6.0.0) XHDPI Phone" /memSize 3072 /diagonalSize 5.7 /video "1440x2560" /vhd "C:\Users\lbthe\AppData\Local\Microsoft\VisualStudioEmulator\Android\Containers\Local\Devices\vhd\5.7_Marshmallow_(6.0.0)_XHDPI_Phone\image.vhd" /name "VS Emulator 5.7-inch Marshmallow (6.0.0) XHDPI Phone.lbthe" /noStart /silent
4> 9/9/2016 10:15:27 PM : [Critical] XDE Exit Code: CouldntCreateInternalSwitch (16)

我读到我应该创建一个内部交换机和一个外部交换机。我可以成功地制作一个内部的,但是当我尝试制作一个外部的时,this 发生了。

使用 Windows 10 Pro 如果对任何事情有用,如果您需要更多信息,我很乐意提供。

【问题讨论】:

  • 您的 Hyper-V 似乎有问题,无法创建虚拟网络交换机

标签: c# android visual-studio xamarin android-emulator


【解决方案1】:

我之前遇到过这个问题,我需要重新安装 Windows

【讨论】:

  • 我可能必须这样做,但问题是我需要半 TB 的数据,而不仅仅是用于我不想擦除以进行全新安装的编码。太麻烦了,但如果没有其他方法,这将是最后一步。
【解决方案2】:

我以前也遇到过这个问题。您可以随时重新检查是否将开发人员模式设置为 true。转到您的设置-> 更新-> 然后开发人员确保已打开开发人员模式。然后您还需要确保您的计算机通过 BIOS 启用了 Hyper-V,有时它们会被关闭。如果您没有 Hyper-V 功能,那么您使用模拟器就很不走运了。你将不得不下一个最好的事情。在测试的安卓手机上安装它。

这个链接可能有用

https://blogs.msdn.microsoft.com/visualstudioalm/2015/07/20/using-the-visual-studio-emulator-for-android-from-android-studio-or-eclipse-with-adt/

【讨论】:

  • 刚刚在 Windows 设置中启用了开发人员模式,但我仍然卡在这里:imgur.com/o5epAL7 我的电脑是 Hyper-V 兼容的,我已经检查过各种方法,如 Coreinfo 和 intels 处理器识别实用程序.
  • Windows 10 上的开发者模式与 Android 开发和 Xamarin 无关。
  • 我打电话给微软,他们说唯一的解决办法是使用同步电缆并在我的微软开发帐户中注册手机。他们还说启用了开发人员模式他们还告诉我重新安装模拟器......重新安装Windows不会做任何事情。如果您在 bios 中有 5 个 hyper-v 选择并且 4 个能够被激活,那么模拟器将无法工作,因为所有 5 个都没有激活。尝试运行 windows phone 模拟器。如果您有问题,那么您的计算机不完全支持 Hyper-V。如果 windows phone 确实可以工作,那么使用 android 模拟器可能是一个错误的下载。
猜你喜欢
  • 2015-06-15
  • 2015-02-18
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2017-09-28
相关资源
最近更新 更多