Visual Studio: Xamarin - Error starting Android Emulator
Asked Answered
P

11

17

Problem encountered on https://dotnet.microsoft.com/learn/xamarin/hello-world-tutorial/devicesetup

Operating System: Windows 10 Pro

Using the Hello World xamarin example in Visual Studio - I'm unable to start the Android Emulator.

When I click on the Run button in the Android Device Manager - the error appears immediately (See attached)

Error-AndroidDeviceManager (Emulator including Google Play/Google API) enter image description here

Emulator error

Device error: WARNING: unexpected '-prop' value ('monodroid.avdname=pixel_2_pie_9_0_-_api_28'), only 'qemu.' properties are supported WARNING: unexpected '-prop' value ('emu.uuid=4b63b139-cc77-4b66-9200-0d25f8fc545e'), only 'qemu.' properties are supported

Same Error when Emulator is not using Google Play/Google API

enter image description here

Same Error when Emulator is not using Google Play/Google API

enter image description here

Windows Specifications Edition: Windows 10 Pro Version: 1909

Processor AMD Ryzen 9

Task Manager: Performance: Virtualization is Enabled

cmd - systeminfo: Hyper-V Requirements: VM Monitor Mode Extensions: Yes Virtualization Enabled In Firmware: Yes Second Level Address Translation: Yes Data Execution Prevention Available: Yes

Visual Studio 2019 enter image description here

Windows Features On/Off (see attached - shows Hyper V / Virtualization enabled as per documentation): WindowsFeatures enter image description here

I tried this way too - adding the Virtual Machine Platform - same error enter image description here

Android SDK Settings

Android SDK - Platform

Android SDK - Tools - part 1

Android SDK - Tools - part 2

Android SDK - Tools - part 3

Android SDK Version: enter image description here

Could the issue be related to the Android SDK Tools - only showing Android SDK Command-line Tools versions 1.0 to 2.1? Could the issue be related to Android Repository perhaps missing on the bottom right hand side? enter image description here

I've now also included the Android SDK Repository under the tools - but this is still not coming through: enter image description here

Pulse answered 21/9, 2020 at 20:2 Comment(9)
Have a look at solutions in this thread may help.Sidelight
thanks Jack - that's helpful. I took a look at the thread, looks like I've done the same - I double checked the Android SDK - looks okay? I'll update main message with screenshots of my Android SDK settings.Pulse
Are you using the latest visual-studio? Can you try to create a new emulator without check Google Play?Sidelight
yes - latest version of Visual Studio - VS 2019 - I'll add a screenshot with the details to the main message. I tried without Google play - same exact error, again I'll add a screenshot with the details to the main message. I do think the issues lie with the settings somewhere - but unsure exactly which settings need updating.Pulse
It looks like everything is installed well on your side. You can report a problem inside Visual-Studio and get more help.Sidelight
Thanks - I raised it a couple of days ago.. but no response yet. github.com/xamarin/get-started/issues/33Pulse
I think you should report this problem to Developer Community.Sidelight
thanks for this suggestion - I've just done that too: developercommunity.visualstudio.com/content/problem/1198435/…Pulse
Yes, wait response there.Sidelight
C
6

You should also check Virtual Machine Platform in Turn Windows features on or off. Also, note that the tutorial that you linked to use an Android device for USB debugging.

EDIT Here are my Android SDK Manager settings
Platform Settings

Platforms tab

Tools

Tools tab

Circularize answered 22/9, 2020 at 11:53 Comment(6)
Thanks for this suggestion - I've updated my Virtual Machine Platform - but same error appears. I'll update the main query with screenshot, in case there's anything else that needs to be updated. I also have tried the other option of using an Android device directly - which works fine - no issues there, but I wanted to get the Android Emulator working in the best way, saves me having to deploy on to my own device each time.Pulse
FYI - the link I shared describes both debugging using a physical Android device and using the Android Emulator.Pulse
You appear to have different settings in Tools than I have. Make sure that you have the latest update of Android SDK Manager and Android Device Manager. As a comparison I have: Windows 10 Core i7, Device Manager version16.6.0.48. Finally it helps to just create a new emulator in Device Manager. I've had to do this fairly recently.Circularize
thanks for this - can you post a screenshot of your settings that I could try and update? Android SDK Manager looks to be the latest. How do I check/update the Android Device Manager? Also, can you send a screenshot of your Emulator in Android Device Manager? For the emulator, I setup using the default selection, I can try your setup in case it helps.Pulse
Added pictures of SDK Manager. You can check your version under the settings on the lower right of the Android SDK and Tools window.Circularize
Thank you! I've added Android SDK Manager screenshots to the main message too. My Android SDK Manager is 16.7.0.13 My Android SDK Tools - only showing Android SDK Command-line Tools versions 1.0 to 2.1... is that correct? The Android Repository is showing on the bottom right hand side - again not sure if this is related either.Pulse
A
5

I had also the same problem, but I have already fixed as next process.

  1. disable both [Hyper-V] and [Windows Hypervisor Platform].
  2. restart PC.
  3. enable both [Hyper-V] and [Windows Hypervisor Platform].
  4. restart PC.
Assassinate answered 14/11, 2020 at 21:42 Comment(0)
N
5
  1. Disable the hyper-v via the following command on command line and reboot.

    bcdedit /set hypervisorlaunchtype off

  2. Enable it back with the following command and reboot.

    bcdedit /set hypervisorlaunchtype auto

Now my emulator runs!

It seems like there is some kind of conflict with virtualization as per this and it effects creating Linux VMs too but these steps clears it.

The answer by suzukimi is right but I provided the commands and some additional info.

Nickolenicks answered 31/12, 2020 at 17:50 Comment(1)
these cmds are the solution indeed. below cmd from Vitenuto is the reason causing this error. I am not sure the difference. they look same cmdFancied
B
3

I had exactly the same problem, so I went to my UEFI settings and I realized that my SVM Mode was disabled. I don't know what motherboard you have but for Gigabyte this usually is in:

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

Bridgetbridgetown answered 3/11, 2020 at 10:35 Comment(1)
Thanks for this - using an ASUS motherboard, I already have SVM Enabled in the UEFI settings: ______ ______ Advanced -> CPU Configuration -> SVM Mode ______ I believe this is also shown in the command prompt that I highlighted earlier: ______ command prompt, cmd: systeminfo ______ Hyper-V Requirements: VM Monitor Mode Extensions: Yes ______ Virtualization Enabled In Firmware: Yes ______ Second Level Address Translation: Yes ______ Data Execution Prevention Available: YesPulse
D
2

I had the same problem, solved it by turning on the virtualization in the bios

Dexterdexterity answered 17/2, 2021 at 19:44 Comment(0)
K
2

I struggled with this issue for 2 days. I even installed Android Studio and run its own emulator to make sure the issue is not Xamarin. Finally it is solved. In my Dell laptop running Windows 10 with Hyper-V installed, there are two issues causing this:

  1. Run Command prompt in Admin mode. type bcdedit. On the last entry all the way down, make sure hypervisorlaunchtype is Off. By default it is set to Auto. To change this setting, type:
bcdedit /set hypervisorlaunchtype off

Admin Prompt

  1. Make sure to run the emulator on the laptop screen. Not on any other monitor. Somehow Android emulator crashed my laptop graphics driver when it is on other monitor.
Knowable answered 28/12, 2021 at 22:10 Comment(0)
K
0

I had same issue after I brainlessly type some command which ADB I think recommend it to me. After a while a realize, that even WSL does not work (Ubuntu in WSL and Docker) so I started to troubleshoot this one and finaly find solution

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

source

this typing in powershell fix all issues for me with Hyper-V and WSL

Kaleidoscopic answered 6/11, 2020 at 10:13 Comment(0)
M
0

I had the same issue turns out the issue was that the intel HAXM wasn't installing properly from the SDK manager window. So I downloaded the Installer directly from the repo. and installed it via the exe.

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

Restarted Visual studio. Worked perfectly.

Mitigate answered 11/8, 2021 at 21:40 Comment(0)
H
0

Go to BIOS and enable Virtualization Technology and of course also make sure the Windows Feature (Hyper-V is installed - all components).

In my case, BIOS was reset when I changed my CPU battery.

Hemline answered 3/3, 2022 at 9:42 Comment(1)
Don't know why it is downvoted when I actually experienced it and fixed it this way. It may not help the OP. But this is one of the solutions for the above problem. I got the same error and I enabled Virtualization it from the BIOS to fix it.Hemline
L
0

This recently happened to me. After some research, I discovered that Microsoft Hyper V was the issue, but the machine I was trying to use it on was Windows 10 Home edition. It had to be Professional, Enterprise, etc. It's not compatible with the version of Windows. Hope this helps.

Lightish answered 5/4, 2022 at 15:57 Comment(1)
Could you provide a source?Papyrus
C
0

I had the same problem, what fixed it was putting android device manager on my second monitor and starting the emulator there.

Celisse answered 3/2 at 12:46 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.