Can I run Android Studio (Android SDK emulator) in a Microsoft hyper-v virtual machine?
Refer to this link:
How to run Android Studio on Windows without disabling Hyper-V
The solution (if you do not want to disable Hyper-V) is to use Microsoft’s Android emulator, which is a free download here.
In order to use this with Android Studio, you need to run the emulator first. Then, in Android Studio, go to Run
> Edit Configurations...
and select Show Device Chooser Dialog under Deployment Target Options.
Run your project, and select the VS Emulator, ignoring the invitation to “Turn off Hyper-V”.
Android Studio Emulator is not working on Windows 11 using WHPX
Final Update:
As stated by Георги Ангелов:
The latest version of Android Emulator - 31.1.2 is fixing the issue. Update through SDK Manager. Released 11/11/2021.
Update:
As stated in Mark Wood-Patrick answer, the emulator hasn't been updated yet but you can download the new emulator binaries with the fix!
From https://issuetracker.google.com/issues/202188690#comment48
windows: https://dl.google.com/android/repository/emulator-windows_x64-7869535.zip
linux: https://dl.google.com/android/repository/emulator-linux_x64-7869535.zip
macosx: https://dl.google.com/android/repository/emulator-darwin_x64-7869535.zip
WHPX as of now is not working with Windows 11, I will update this answer when it gets fixed.
There are two possible workarounds:
Disable Hyper-V (Keep in mind WSL2 or any VM won't work without this)
To disable Hyper-V you must follow these steps:
- Open
Turn Windows features on or off
. - Uncheck
Hyper-V
andWindows Hypervisor platform
(it may be required to uncheckWindows Sandbox
). - Open Android Studio and SDK Manager.
- In SDK tools, install
Android Emulator Hypervisor Driver for AMD Processors (installer)
.
Open the emulator with no acceleration
- Open a terminal.
- Enter
cd C:\Users\User\AppData\Local\Android\Sdk\emulator\
with your user. - Enter
.\emulator.exe -avd Pixel_4a_API_30 -accel off
with your AVD device name.
Not possible to run Android Studio and Docker on Windows because of Hyper V
This is a common problem for computers without an "Intel" processor. Install any emulator with Genymotion (VirtualBox optional) because currently the new versions of docker no longer require VirtualBox.
Although if you are very lucky and / or have a computer with an intel processor, simply activate virtualization from BIOS.
Tutorial:
https://www.youtube.com/watch?v=MOuTxfzCvMY
Can not start android emulator - Hyper V detected but Hypervisor platform is not available
It's very weird but still to this day I can't start the android emulator in VS2019. However, I found a workaround - I can start the android emulator in VS2017, so I start it there and run the app from VS2019. Extremely weird, but if anyone is having that issue and needs a workaround urgently, that's what you can do.
I don't know if this is helpful at all, but as for today, that's the only solution I found.
(Also, consider switching to VS2022. Seems to work fine there as well)
How to use Android Emulator on AMD Ryzen (Android Studio)?
For Ryzen on Windows 10, use the latest stable instead of canary.
- Enable virtualization in BIOS.
- Remove HAXM.
- Turn off Hyper-V, Windows Hypervisor platform, Windows Sandbox(depends on your windows version, old versions may not have all). REBOOT
- Launch SDK Manager via Android Studio and you should see "Android Emulator Hypervisor Driver for AMD Processors". Check and click "Apply". The SDK Manager will download the installer package and unpack it to
$ANDROID_SDK_ROOT\extras\google\Android_Emulator_Hypervisor_Driver.
Then,
- Open a Windows command console with administrator privileges.
- Go to $ANDROID_SDK_ROOT\extras\google\Android_Emulator_Hypervisor_Driver.
- Run silent_install.bat. Make sure you see the desired output from the installer:
STATE: 4 RUNNING
Can't run Android Studio Emulator on AMD - ERROR: x86
After plenty of research I found a solution for my ryzen system:
(source: https://github.com/intel/haxm/issues/105)
Turn this windows setting on and somehow it will work. Don't ask me why.
I also found an official new amd driver: https://androidstudio.googleblog.com/...
But I was already using the new driver. It did only work after I switched the setting above.
Related Topics
How to Hide The Soft-Key Bar on Android Phone
Use 32-Bit Jni Libraries on 64-Bit Android
Add Viewpagerindicator to Android Studio
How to Set Status Bar Background as Gradient Color or a Drawable in Android
Speechrecognizer Causes Anr... I Need Help with Android Speech API
Play Store Having New Version of The App, But Not Showing Update
Unfortunately App Is Getting Stopped While Checking for Network
Pdf Library for Android - Pdfbox
Onactivityresult Do Not Fire If Launch Mode of Activity Is Singleinstance
Can't Resolve Android Databinding Class
How to Change Color of Vector Drawable Path on Button Click
Combining Two Bitmap Image (Side by Side)
How to Repeat Notification Daily on Specific Time in Android Through Background Service
Glide Showing Error: Failed to Find Generatedappglidemodule
Starting Activity Through Notification: Avoiding Duplicate Activities