Can't install Android Emulator for AMD Processors
Asked Answered
G

8

40

I have windows 10 Home and AMD ryzen 5 processor. I'm using android studio 4.0 canary 7 (I also tried the latest stable version with the same error). I'm following the official tutorial to enable the Android Emulator for AMD Processors here..

https://androidstudio.googleblog.com/2019/12/emulator-29211-and-amd-hypervisor-12-to.html

This is relatively new and I created an issue for them but wanted to see if someone might help with this or had this problem before. So everything looks good until the step to install gvm as administrator by going to the directory (Android_Emulator_HyperVisor_Driver) and running silent_install.bat. For some reason it is failing to run the service and I get the following error

[SC] ControlService FAILED 1062:

The service has not been started.

[SC] DeleteService SUCCESS
[SC] StartService FAILED with error 4294967201.

Hypervisor platform is disabled (It should according to this latest tutorial as this is different than how it was last year). Any feedback or suggestions are appreciated.

Gomulka answered 1/1, 2020 at 4:27 Comment(2)
I had the same error, it was because Device Guard wasn't correctly disabled, you should follow this tutorial https://www.youtube.com/watch?v=VIBdY-5zr58 After that restart your computer and try again with admin command promptSupergalaxy
@Xlucxs This is the real, correct answer. You should edit you previously deleted answer and add more details as it was useful to me. Thanks.Preform
G
3

I found the answer after long time. I had to enable Virtualization on my machine.

Gomulka answered 1/1, 2020 at 17:4 Comment(1)
You could help more by telling how to enable that :)Stated
P
24

If you tried everything (turning windows features off, enabling svm in bios..etc) and still didn't work, type bcdedit in the command prompt, and press ENTER. If you see an entry for hypervisorlaunchtype set to Auto, Hyper-V is still enabled. You can try setting the launch type to Off by running the command below.

bcdedit /set hypervisorlaunchtype off

That's the only thing that worked for me after trying literally everything.

Presage answered 11/4, 2021 at 14:39 Comment(0)
C
16

If You are using AMD Ryzen Just go to bios setting check for SVM Mode if it is Disabled then Enable it .. Emulator work perfectly..Below Link show where to enable SVM Mode in Aorus Gigabyte Motherboard BIOS..

https://www.youtube.com/watch?v=46DfLwX5AFQ

also Disable hyper-v in windows feature.. sample below

https://github.com/google/android-emulator-hypervisor-driver-for-amd-processors/wiki/Is-Hyper-V-really-disabled%3F

After this emulator will works like a charm...

Carnahan answered 9/12, 2020 at 7:24 Comment(2)
This is the only solution that worked for me. Thanks mate. Remember when doing a BIOS flash updating, the SVM feature may get disabled again for some stupid reason, which is what happened in my case.Dilatory
Unfortunately, this breaks Docker, because Docker requires VM support. So, one cannot have both Docker (Desktop) and Android Studio on the same (Windows) AMD Ryzen based computer.Dryly
P
8

Go to BIOS setting of your laptop/PC, and enable the SVM setting and save it. This should work. This issue is because Virtualization on the PC is disabled once it is enabled it works. Please let me know if it doesn't work.

NOTE : BIOS - As your PC’s most important startup program, BIOS, or Basic Input/Output System, is the built-in core processor software responsible for booting up your system.

Restart your machine and press the hotkey, your BIOS setting will be opened.

These are some brands hotkey, might be useful.

  • Acer: F2 or DEL

  • ASUS: F2 for all PCs, F2 or DEL for motherboards

  • Dell: F2 or F12

  • HP: ESC or F10

  • Lenovo: F2 or Fn + F2

  • Lenovo (Desktops): F1

  • Lenovo (ThinkPads): Enter + F1.

  • MSI: DEL for motherboards and PCs

  • Microsoft Surface Tablets: Press and hold volume up button.

  • Origin PC: F2

  • Samsung: F2

  • Sony: F1, F2, or F3

  • Toshiba: F2

Popover answered 31/10, 2020 at 6:16 Comment(0)
V
6

If you are using Avast antivirus (or AVG), this can be the cause of this problem.

So things to do to fix this:

  • Activate Virtualization in bios
  • Deactivate Hyper-v and hypervisor platform in "activate/desactivate windows function" & run powershell as admin and run the following command: Disable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V
  • In Avast Antivirus. In settings click Troubleshoot on the left side of the screen, uncheck the box next to Enable hardware assisted virtualization, then click OK to confirm and restart your computer

I've got the solution from https://github.com/google/android-emulator-hypervisor-driver-for-amd-processors/issues/10#issuecomment-715423881.

Voussoir answered 19/11, 2020 at 20:2 Comment(1)
If you are using AVG Free you may also need to disable virtualization. Do this in Settings > Troubleshooting and then uncheck "Activate hardware virtualization". Then restart computer.Unicuspid
G
3

I found the answer after long time. I had to enable Virtualization on my machine.

Gomulka answered 1/1, 2020 at 17:4 Comment(1)
You could help more by telling how to enable that :)Stated
W
1

I have tried everything that's written here, with no success.

For me an option in BIOS (AMD V(TM), which is actually the same (or maybe almost the same) as SVM or SVM Mode) was ON already. And I didn't try to touch it at all. So I was going to write to support already. And in the process of gathering information for that I have turned that option off in BIOS. And then ON again (with restarts on every step ofc). Then I have discovered, that the folder with silent_install.bat has dissapeared. So I went to Android Studio and discovered that Emulator just works.

So, If you had tried everything, try to just turn off virtualization in BIOS and after restart turn it back On.

Wohlert answered 5/8, 2022 at 15:53 Comment(0)
F
0

I am using Windows 11.

In addition to all the other answers, I also had to disable Core Isolation (in Windows Defender options).

Windows Security -> Device Security -> Core Isolation -> Memory Integrity

Set to 'Off' and then restart.

Image showing option for disabling Memory Integration Protection

After the reboot, I was able to run the silent_install.bat from an Admin PowerShell prompt as follows:

Pic showing the path where I ran silent_install.bat and the success message

Fives answered 28/2 at 13:4 Comment(0)
T
-5

I'm just a hobbyist so I have no idea why this works but if you install NoxPlayer (Android emulator), Android Studio emulator works perfectly.

Tritanopia answered 31/8, 2020 at 14:8 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.