Visual Studio:Xamarin-启动Android Emulator

问题描述

https://dotnet.microsoft.com/learn/xamarin/hello-world-tutorial/devicesetup上遇到的问题

操作系统:Windows 10 Pro

在Visual Studio中使用Hello World xamarin示例-我无法启动Android模拟器。

当我单击Android设备管理器中的“运行”按钮时-立即出现错误(请参见附件)

Error-AndroidDeviceManager(包括Google Play / Google Api的仿真器)

enter image description here

仿真器错误

设备错误:警告:意外的“ -prop”值(“ monodroid.avdname = pixel_2_pie_9_0 _-__ api_28”),仅是“ qemu”。支持属性 警告:意外的“ -prop”值(“ emu.uuid = 4b63b139-cc77-4b66-9200-0d25f8fc545e”),仅是“ qemu”。属性支持

模拟器未使用Google Play / Google Api时出现相同错误

enter image description here

模拟器未使用Google Play / Google Api时出现相同错误

enter image description here

Windows规范 版本:Windows 10 Pro 版本:1909

处理器 AMD锐龙9

任务管理器: 性能:虚拟化已启用

cmd-systeminfo: Hyper-V要求:VM监视器模式扩展:是 在固件中启用虚拟化:是 二级地址翻译:是 可以执行数据执行保护:是

Visual Studio 2019

enter image description here

打开/关闭Windows功能(请参阅附件-显示根据文档启用的Hyper V /虚拟化): Windows功能

enter image description here

我也尝试过这种方法-添加虚拟机平台-同样的错误

enter image description here

Android SDK设置

Android SDK - Platform

Android SDK - Tools - part 1

Android SDK - Tools - part 2

Android SDK - Tools - part 3

Android SDK版本:

enter image description here

该问题是否与Android SDK工具有关-仅显示 Android SDK命令行工具 1.0到2.1版本? 问题可能与Android存储库相关,而右下角可能丢失了吗?

enter image description here

我现在还在工具下包括了Android SDK存储库-但这仍然没有实现:

enter image description here

解决方法

您还应该在打开或关闭Windows功能中选中虚拟机平台。另外,请注意,您链接以使用Android设备进行USB调试的教程。

编辑 这是我的Android SDK Manager设置
平台设置

Platforms tab

工具

Tools tab

,

我遇到了完全相同的问题,因此我进入了UEFI设置,并且意识到我的SVM模式已禁用。我不知道您拥有什么主板,但是对于技嘉来说,通常在以下位置:

M.I.T → Advanced CPU Core Settings → SVM Mode

,

我无脑地键入一些我认为是亚行推荐给我的命令后,我遇到了同样的问题。过了一会儿,即使是WSL也不起作用(在WSL和Docker中为Ubuntu),所以我开始对此问题进行故障排除并最终找到解决方案

DISM /Online /Enable-Feature /All /FeatureName:Microsoft-Hyper-V
bcdedit /set hypervisorlaunchtype auto

source

这种在Powershell中的输入为我解决了Hyper-V和WSL的所有问题

,
  1. 在命令行中通过以下命令禁用 hyper-v 并重新启动。

    bcdedit /set hypervisorlaunchtype off

  2. 使用以下命令重新启用它并重新启动。

    bcdedit /set hypervisorlaunchtype auto

现在我的模拟器可以运行了!

似乎与 this 中的虚拟化存在某种冲突,它也会影响创建 Linux VM,但这些步骤清除了它。

suzukimi 的回答是正确的,但我提供了命令和一些附加信息。

,

我遇到了同样的问题,通过打开bios中的虚拟化解决了

,

我遇到了同样的问题,原来问题是英特尔 HAXM 没有从 SDK 管理器窗口正确安装。 所以我直接从 repo 下载了安装程序。并通过exe安装。

这里:https://software.intel.com/en-us/android/articles/intel-hardware-accelerated-execution-manager

重新启动 Visual Studio。完美运行。

,

我也遇到了同样的问题,但是我已经解决了下一个过程。

  1. 同时禁用[Hyper-V]和[Windows Hypervisor平台]。
  2. 重新启动PC。
  3. 同时启用[Hyper-V]和[Windows Hypervisor平台]。
  4. 重新启动PC。