-
Notifications
You must be signed in to change notification settings - Fork 827
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Android emulator not starting anymore #6471
Comments
Neither on Windows itself nor on WSL. It has been like this for about two weeks. |
I have the same problem! |
Same problem. it was broken by windows update 21292.1000 Windows 21301.1000 |
Hey guys, I think the workaround is to turn off HyperV when Windows startup, maybe there is a conflict between HyperV and HAXM (I thought this problem is already resolved in the latest version of Android Studio?) To do this, open Powershell as Admin -> Hopefully, there will be a solution for this problem since it's pretty inconvenient to switch back and forth just to get the emulator working. |
@viet-quocnguyen This is not a workaround, since some folks (like me) rely on simultaneously running WSL2 and emulators. |
@ad-on-is I see... It will be a pain but maybe you could try to run the APIs on windows instead? Just a temporary set up so you could get work done I guess. |
@viet-quocnguyen Sure, there are multiple temporary solutions, like switching to VirtualBox. |
Is there any official statement regarding this issue? |
Thanks for reporting the issue, we have routed the report to the correct team and they are investigating a fix. |
Wondering has there been any update on this? It's a pretty big blocker for me. I'm unable to disable Hyper-V since I rely on WSL2 for the development work that the emulator is using. Thanks! |
@ALL WSL2 has it's own feature known as VMM (Virtual Machine Management) that is required to be added in addition to the WSL feature for WSL2 to run. It is based on Hyper-V but does NOT require the Hyper-V feature to be enabled to run. The only reason to also enable Hyper-V is if you still wish to run VMs in Hyper-V or to use it's commandline functionalities to "hack" WSL2 for stuff like virtual NICs as workarounds. Has anyone actually tested the emulator not working with only WSL2 enabled and NOT Hyper-V? I think it's still likely to be broken but there's a small chance it can still work until proven otherwise. |
I think this issue is extremely low prioritized, since the percentage of users who run WSL2 and Android emulators simultanously is very low. |
I tested all possible options of enabling/disabling Windows Features and it comes down to either have a working emulator, or a working WSL2/Docker, but not both. Maybe I still may have missed something, and someone can point to a workaround. |
Likely. If it were a new feature request that would be one thing, but I'm hoping that because it's something that USED to work a few weeks ago and has since been broken with an update, that's it's something that be corrected without too much headache. |
Definitely! It used to work before Windows 21292 (iirc). |
I have same issue. Ryzen 3900X |
Same issue. Windows Insiders 21318 |
Same issue, 21322 Dev |
I wonder if backing up from Dev to Beta will give me a version where the emulator will work again? It'd be helpful if the "Pick your Insider settings" screen would dynamically tell you just what version each corresponds to. |
This page does give versions for Dev, Beta, and Release Preview at the bottom: |
I have tested on my laptop (HP OMEN15, i7-10870H, RTX2060) that the build 21327 fixed the problem . |
Can confirm, Windows 21327 fixes the issue. |
Can confirm |
I can also confirm that this fixes the issue for me.
|
I'd be very curious to know just what changed to fix things. |
21327 fixed the issue for me on AMD/Nvidia platform |
21327 fixed the issue. Thanks guys! |
I found a temporary workaround by running Android Emulator with Hyper-V Manager. Description here. EDIT |
Same error as @otocon, WHPX is not working for AVD in Windows 11, please reconsider opening the issue.
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 the emulator with no acceleration
|
you are a legend this really fixed the issue don't run the emulator on your second screen, only your main monitor. |
Doesn't help for me. |
I thought this could do it for me too, but it's so damn slow it's not even usable on my machine - I mean, 20 minutes to launch, 30 seconds to register a click... No can do. The "main monitor" stuff just feels weird to me and of course doesn't help at all in my case. Which makes me wonder. Are we better off letting go of WSL2 and try to run our API in a Virtualbox or similar? Since it's visibly a very low priority bug... Even lower for Ryzen users like me... |
I'm looking for a fix for this too, I'm using Windows 11 Pro - 21H2 22000.194 and AVD doesn't work with Virtual Machine Platform enabled, but if I disable AVD works and WSL 2 don't. I'm think that's valid to reopen the issue |
Im facing the same issue, Windows 11 Home 21H2 22000.258. |
There is a workaround, kind of, until this is (hopefully soon, but seeing how there are all kinds of problems with Ryzen (scheduler...) I'm not holding my breath...) fixed. I got the emulator working at good speed (and reasonably stable, so far) by installing Android Studio inside WSL2, and by installing the vGPU drivers for WSLg, AND by updating the Mesa drivers to the latest version. Like so: wslgsee https://github.com/microsoft/wslg
in WSL shell
Install vGPU graphics drivers (see links on wslg page) Install latest Mesa driverssee https://itsfoss.com/install-mesa-ubuntu/
Install Android Studio
I'm using
also add
to your Obviously this may vary slightly for bash etc. You probably also need to fiddle with the It also means that you have to do your coding inside WSL. |
This bug needs to be reopened. can confirm there is no way to run an emulator with any of the above in Windows 11 with hyper v. |
Damn it! Wasted two days on this! Now I have to downgrade to window 10 and setup whole thing once again :( |
I've tracked this problem down to an issue with the Android Emulator WHPX (Windows Hypervisor Platform) support. (Or a breaking change in the WHPX APIs in Windows 11) It does not appear to be related to WSL other than that by enabling WSL you would also need to enable WHPX to have hardware acceleration of the Android Emulator. I've built the Android Emulator from source with some very small changes to the WHPX integration and in my (admittedly very basic) testing, it appears to function correctly. For what it's worth, I am on an Intel i7-1185g7 CPU and it worked fine prior to the Windows 11 upgrade. |
I am getting this issue in AMD Ryzen 7. Also, this issue is more there only in AMD chipset and not in windows. I am using an i7 7700HQ and it works flawlessly there. |
Reproduced on i7-1165G7 with a clean install of Android Studio on Windows 11 (22000.258). |
Facing the same issue. Tried almost all ways I can find to make AVD and WSL2 work at the same time. In the end, it turned out to be totaly a futile attempt. Reopen this issue please. System info:
|
Having the same issue here.
Here's a link to the Google issue tracking this: https://issuetracker.google.com/issues/202188690?pli=1 |
I found a solution from the Google issue tracker to make AVD work with Hyper-V enabled on my AMD CPU. https://issuetracker.google.com/issues/202188690#comment18 This requires compiling qemu, but I didn't encounter problems while following the guide. Binary files compiled by me: https://paste.c-net.org/BlatantEnjoying (a random site that can upload files, the word in the URL is meaningless). Extract to |
You actually made it work! I copied the binary files to Thanks btw. |
@LefanTan The change is from https://issuetracker.google.com/issues/202188690#comment18, I only do the compiling work. Commenting out this line |
Nice Job. It worked for me as well. |
it worked for me on my zephyrus laptop, AMD Ryzen 9 5900HS Edition Windows 11 Pro Insider Preview |
Confirmed working. Thank you! |
@RikkaW Thank you sooooooo much! |
Bah, this was working until I rebooted my computer.
[0074d13f-3dde-4b01-9c47-883048e75621]
|
I replaced qemu files from the archive to <ANDROID_SDK>/emulator/qemu/windows-x86_64 as you said but have another error now:
Before the replacement the error was:
My CPU and Android Emulator configiguration is: |
I've experience this today after installing WSL on Windows 11, Just refer to this comment and will save you from headache. I spent 5 hours screaming in agony without knowing Android emulator will not work if you have WSL installed on a Ryzen setup. I really agree, we need to reopen this issue. |
This seems to indicate AMD + win11 + Hyper-V (that is, WSL2) can work now https://issuetracker.google.com/issues/202188690 |
What is windows 21327? |
solved with |
Windows 10 21296
AMD 4800H
I don't know whether this is related to WSL, Windows or Android emulator itself, but here's what's happening.
I used to run WSL2, Docker (WSL2) and Android Studio emulator side-by-side. Everything worked.
Docker was up and running in WSL2.
I could launch emulators from within Android Studio.
Now, the emulators stopped working.
AVD Manager throws a
The emulator process for AVD Pixel_4_API_30 was killed.
error, without further information.When I try to run it manually via the console, I get these errors:
.\emulator -avd Pixel_4_API_30
The text was updated successfully, but these errors were encountered: