Emulator in Android Studio doesn't start - android

I think it's a problem with the SDK reference in Project Structure, but when I click run and I choose Launch Emulator nothing appears.

I had the same problem. I just created the AVD with 768 MB RAM and it did run fine!
UPDATE: November 2022
This answer was almost from 10 years ago and will most propably not work on current version of Android Studio.

I had a similar problem... Android Emulator doesn't open.
You need to discover the reason of this... You could run your emulator from the command line. For this you could copy and paste your command line from "Run" or "AVD" Android Studio console.
For example:
"{path}\android-sdk\tools\emulator.exe -avd Default_Nexus_5 -netspeed
full -netdelay none"
When you launch it from a command line terminal, It give you a message with the error.
In my case it was useful for discover the problem:
..\android-sdk\tools>emulator: ERROR: x86 emulation
currently requires hardware acceleration! Please ensure Intel HAXM is
properly installed and usable. CPU acceleration status: HAX kernel
module is not installed!
I needed to activate GPU acceleration with a tool to enable it on my machine.
I solved it installing from SDK Manager the tool HAXM...
I had another problem... For example i had assigned a bad url for skin path of my virtual device...
To solve it I have configured my virtual device with a valid skin from my platform sdk: '{path}\android-sdk\platforms\android-{number}\skins{SCREEN_SIZE}'
Now it is opening fine.
Update 8/8/2019:
For newer version of Android SDK, emulator path should be:
"{path}\android-sdk\emulator\emulator.exe"
reference (thank you #CoolMind)

In my case the android hangs at start up. I solved by wiping user data and forcing a cold boot, using Android Virtual Device Manager (Tools->AVD Manager)

It seems that "Waiting for target device to come online ..." is a generic message that appears, always, when the emulator can not start properly. And what's the cause of that? As you can see, there could be many causes.
I think the best way to find the concrete error with the emulator is to start it within a terminal. So:
1 - Open a terminal and go to this folder:~/Android/Sdk/tools
2 - Start the emulator with this command:
./emulator -avd EMULATOR_NAME -netspeed full -netdelay none
You can see the name of your (previously created with AVD Manager) emulators with this command:
./emulator -list-avds
If everything is ok, the program doesn't start, and it writes in the terminal the concrete error.
In my case, the application says that there is a problem loading the graphic driver ("libGL error: unable to load driver: r600_dri.so"). As it is explained here, it seems that Google packaged with Android Studio an old version of one library, and the emulator fails when it tries to use my graphic card.
The solution? Very easy: to use the system libraries instead of the packaged in Android Studio. How? Adding "-use-system-libs" at the end of the command. So:
./emulator -avd EMULATOR_NAME -netspeed full -netdelay none -use-system-libs
The definitive solution is to set the ANDROID_EMULATOR_USE_SYSTEM_LIBS environment variable to 1 for your user/system. With this change, when I run the emulator within Android Studio, it will also load the system libraries.
PS 1 - The easiest way I found to set the environment variable, it's to modify the script that launches the Android Studio (studio.sh, in my case it is inside /opt/android-stuido/bin), and add at the beginning this:
export ANDROID_EMULATOR_USE_SYSTEM_LIBS=1
PS 2 - I work with Debian Jessie and Android Studio 2.2.3. My graphic card is an ATI Radeon HD 6850 by Sapphire.
UPDATE December 2017: I had the same problem with Debian Stretch and Android Studio 3.0.1 (same graphic card). The same solution works for me.

1) Open SDK Manager and Download Intel x86 Emulator Accelerator (HAXM installer) if you haven't.
2) Now go to your SDK directory (C:\users\username\AppData\Local\Android\sdk, generally). In this directory Go to extra > intel > Hardware_Accelerated_Execution_Manager and run the file named "intelhaxm-android.exe".
In case you get an error like "Intel virtualization technology (vt,vt-x) is not enabled". Go to your BIOS settings and enable Hardware Virtualization.
3) Restart Android Studio and then try to start the AVD again.
It might take a minute or 2 to show the emulator window.

If you are new to Android studio, you need to follow few basics steps in configuring the emulator.
Make sure you have proper SDK installed
Make sure you have Intel HAXM & virtualization option enabled in your BIOS
Configure emulator correctly, download the Intel X86 Atom system image for better performance.
Go through this blog, http://www.feelzdroid.com/2015/05/android-studio-emulator-not-working-solution.html
Here they have explained clearly, what are the problems you face while running & resolution for the same.

With Ubuntu, I had the same problem. I solved it by changing file /dev/kvm permission to 777:
sudo chmod 777 /dev/kvm

you need to install "Android Emulator"
Go to
SDK Manger -> Appearance & Behavior -> System Settings -> Android SDK -> SDK Tools.
and set a hook at Android Emulator

I had the same issue in Android Studio 2.3.3 on Mac OS X 10.12.6 and the issue was caused by Android Studio using an old version of HAXM (6.0.3 when it should have been 6.2.1):
$ kextstat | grep intel
148 0 0xffffff7f8342c000 0x14000 0x14000 com.intel.kext.intelhaxm (6.0.3) 50449AFC-F7C6-38A0-B820-233E8A050FD6 <7 5 4 3 1>
Removing and reintalling HAXM from within Android Studio according to the instructions didn't work: https://software.intel.com/en-us/android/articles/installation-instructions-for-intel-hardware-accelerated-execution-manager-mac-os-x
Instead, download the HAXM installer manually or if that link expires, find it under https://software.intel.com/en-us/android/tools under Intel® Hardware Accelerated Execution Manager (Intel® HAXM).
After running the installer, it now shows that the current version of HAXM is installed:
$ kextstat | grep intel
169 0 0xffffff7f83472000 0x1d000 0x1d000 com.intel.kext.intelhaxm (6.2.1) 7B6ABC56-699C-3449-A0EC-BEB36C154E3C <7 5 4 3 1>
After upgrading HAXM manually, I'm able to launch x86_64 emulators.
Old answer, which might work instead (note that this didn't work for me for x86_64 images):
Create a new device:
Tools->Android->AVD Manager
+ Create Virtual Device
Tablet -> Nexus 7 -> Next
The Recommended tab should be highlighted.
Even though I had the API Level 25 SDK installed, it showed:
Nougat Download 25 x86 Android 7.1.1 (Google APIs)
So I clicked Download link which seems to have repaired the API Level 25 SDK. I finished creating my new device and it ran fine.
Unfortunately I had already deleted my old device, so if this works for someone else, please leave a comment here to let us know if your original device worked afterwards, thanks!

I'd like to post a link to this answer as it might help out any persons in this thread running into issues starting a virtual device with more then 768 mb of memory;
How to make an AVD with > 768MB RAM To emulate Galaxy devices

I have similar problem but I have solved it by switching to "Android 4.2.2 armeabi-v7a" (I needed to test it on Jelly Bean) in my AVD and it fixed the problem for me.
What seems to happen is that my processor is AMD and Intel X86 hardware emulation couldn't start. So I changed to use "API" other than "x86" (even though it recommended me to use x86). Hope this helps.

I spent several hours on this problem. What worked for me was opening the Tools->Android->SDK Manager, choosing Android SDK under System Settings on the left of the screen and going to the SDK tools tab. I then unchecked the settings for Android emulator and the Intel x86 Emulator Accelerator. I applied these changes, restarted Android Studio and then re-checked these option and applied the changes. The program reinstalled the emulator components and things seem to work. Hope this helps someone.

In Android Studio 2.3.3 I was able to get my AVD to start and run by changing Graphics in the Emulated Performance section from Automatic to Software-GLES 2.0:
I was able to infer this after following the advice at https://stackoverflow.com/a/44931679/1843329 and doing:
$ ./emulator -avd Nexus_4_API_21 -use-system-libs
which resulted in:
emulator: ERROR: Could not initialize OpenglES emulation, use '-gpu off' to disable it.
And when I did:
./emulator -avd Nexus_4_API_21 -use-system-libs -gpu off
the emulator then launched.

Wipe data of AVD like that picture and run your program. it's work for me.

If anyone is still having trouble with launching the avm take note of the android studio event log when you try to run the avm. When I tried running the avm android studio mentioned that my environment variable ANDROID_SDK_HOME was set to the same place as ANDROID_HOME and it shouldn't be. It recommends deleting the variable ANDROID_SDK_HOME which I did and then restarted android studio and avm started working.

Access the BIOS setting and turn on the virtualization feature. Mine was together with options like cpu fan speeds and stuffs.
Then make sure that Hyper-V is turned off in the windows features ON/OFF.
Then reinstall the intel HAXM, this should fix this issue.

edit this file:
sudo nano .android/avd/your_emulator.avd/config.ini
change lines
hw.gpu.enabled = yes
hw.gpu.mode = auto
to
hw.gpu.enabled = no
hw.gpu.mode = off
It works for me !

just check out if you have this problem "vt-x is disabled in bios"
in this case you need to enable virtualization technology bios

It probably won't start because you
no CPU is installed, then follow this answer: Unable to create Android AVD because of Target and CPU/ABI settings?
OR
don't have the correct SDK downloaded
If you migrated your project from Eclipse chances are that on running an emulator you will get stuck with this message not seeing anything else:
Waiting for device.
If you open the device manager you probably see something like this:
Just recreate your devices.

I've faced similar problem. You can edit the configuration or create new AVD with higher RAM. Also try increasing Heap to 128. Emulator will work smoothly even without HAXM

I had the same problem. I just Created New AVD with 768 MB RAM and it did run fine for me. I Used for API 22(Lollipop Version).

Besides using an external emulator such as bluestacks, you can also create a new new AVD and choose a system image with an ABI of armeabi-v7a with an API level of 21, instead of choosing ABI of x86 which fails.
I was having the same problem, i tried this and it worked. hope this will be useful as well.

Check if the following tools are installed or not in the Android SDK Manager as shown in this picture:

One reason could be that the chosen ABI does not fit to your system. For me, only arm64 is working.

I had the same problem on Windows 10, after I moved my android-SDK folder to D:/ as I was low on space on c:/.
It turned out that the Android emulator looks for Android SDK via Global (environment) Variables, not the path defined inside Android Studio.
So I edited the Environment variable of ANDROID_HOME and that was it.

If your emulator worked fine but suddenly it doesn't, just restart the machine and run again.It worked for me.

I faced the same problem. From some research that I did, I realized that my computer does not support virtualization. So I had to install BLUESTACKS.
Believe me it worked...you can also try it.
Just go to your directory C:\Android\sdk\platform-tools and double click adb
Ensure that your bluestack is running.
When you try to run the project, it automatically shows up to run with the bluestacks....just choose the bluestack and you are done.
If you want the setup of bluestack, just google it you can have a number of sites to download from for free.

I performed the procedure below, and was successful.
Execute this command down.
npx react-native info
This command return the log file the npm (example)
C:\Users\Robinho\AppData\Local\npm-cache\_logs\2020-11-22T19_35_23_842Z-debug.log
In my case was permission in dir file in windows SO.

I restarted my computer clicked F1 for the Bios setting and checked the virtualization technology box and saved the changes. The AVD worked without glitches after my computer booted. This article explains it. Hope somebody finds this helpful.

I was having this same problem. I decided to create (see the button at the lower-left). I defined the image to match my device and that seems to work.
I am thinking with Android Studio at version 1.0.1, there are still plenty of bugs.

Related

Android 9.+ emulator does not start

All AVD images work on my machine except for Android 9.+ (Google Play) & Android 9.+ (Google APIs) (the Android Studio emulator for Android Q beta).
I just downloaded the most recent images. From android-Q/google_apis_playstore/x86/build.prop:
ro.system.build.version.incremental=5506116
ro.system.build.version.release=10
ro.system.build.version.sdk=28
I am using Android Emulator version 29.0.11.
However, when I start these up, I see the device frame with a black screen. I get no error message, just nothing. It stays like this indefinitely.
Is there any way to debug this or is this a common issue?
Update: on another device (same image), I got the following screen instead of a black screen, however, there is still nothing I can do:
You need to configure correctly the Hardware Acceleration for your Emulator. Please, follow these steps:
1) Install the Intel HAXM driver if you are on Windows and have Intel, follow these steps:
Open the SDK Manager.
Click the SDK Update Sites tab and then select Intel HAXM.
Click OK.
After the download finishes, run the installer. Typically, you can find the installer in the following location: sdk\extras\intel\Hardware_Accelerated_Execution_Manager\intelhaxm-android.exe
Use the wizard to complete the installation.
After installing Intel HAXM, confirm that the virtualization driver is operating correctly by entering the following command in a Command Prompt window:
sc query intelhaxm
You should see a status message that includes the following information:
SERVICE_NAME: intelhaxm
...
STATE : 4 RUNNING
...
For Linux, check this link
For Mac, check this link
2) Open AVD Manager on Android Studio:
Edit the Virtual Device where you set target Android Q
Click Show Advanced Settings.
Set Graphics to Automatic or Hardware.
In my case all other emulators started, except Q. I have all needed SDK and AVDs.
But every time emulator didn't start without any error.
I saw Emulator in Android Studio doesn't start and found a way to understand a reason. I started from avd path:
D:\Android\emulator\emulator.exe -avd Pixel_2_API_29 -netspeed full -netdelay none
and got an error: PANIC: Broken AVD system path. Check your ANDROID_SDK_ROOT value [D:\Android]!. In PANIC: Broken AVD system path. Check your ANDROID_SDK_ROOT value I found that we should read config.ini inside 'Pixel_2_API_29.avd' folder and detect the line
image.sysdir.1=system-images\android-29\google_apis_playstore\x86\
I understood that I missed android-29 image in SDK path!
I knew that moved SDK and AVD folders from C:... to D:\Android, but SDK was kept in two folders.
And I forgot to change one system variable (ANDROID_HOME):
So I changed it to D:\Android and restarted the PC.
After restarting I deleted old SDK folder (in 'AppData\Local\Android'). Then I started again:
D:\Android\emulator\emulator.exe -avd Pixel_2_API_29 -netspeed full -netdelay none
Android 11 (R) emulator was not working for my case. I fixed it with the following steps.
Step 1:
Go to SDK manager -> SDK Platforms and install your required API level ( Like Android 11.0, Android 10.0, etc. For my case Android 11.0 was not installed that's why it was not working )
Step 2: Go to SDK manager -> SDK Tools and install Intel Emulator Accelerator (HAXM installed) if not yet installed. If you are a windows user then make sure that windows firewall is deactivated for a while otherwise it will not be installed and generate an error.
Step 3: Wipe data and Cold boot the device from ADV manager.
If the above steps are not worked then Invalidate caches and Restart your android studio as well as the PC.
I fixed it by reinstalling Android Studio entirely.
Actually, I just wanted to reinstall the Android SDK, however, you seem to need to install a stable version of Android Studio for that. After that, I set everything up the same way again and ran the beta version and now it works.
Had the same problem on macOS. Found out that I didn't have enough space on disk to create 'userdata partition'. So check that.

Cannot start Android device emulator on Linux

I used to launch and debug Android Studio apps on emulator without problems. However, recently I am constantly failing to start the emulator. Updating the SDK and system images did not solve the problem. Updating qemu-system-* did not help either.
System info: Linux Fedora 25 (x86_64), Android Studio 2.2.3
It turned out that the problem was due to the same old NVidia driver problems with Linux. To fix the crash, I opened AVD Manager from Android Studio (Tools->Android->AVD Manager), and then opened the virtual device settings. Then in the Emulated Performance section, next to Graphics, I selected Software rather than Automatic or Hardware. This does the trick and no more crashes occur for the emulator, though it seems considerably slower, than it used to be when Emulated Performance presumably used Hardware by default. The following screenshots will hopefully give a better hint on the solution.
Have you tried running AVD Manager from a terminal?
Control the Emulator from the Command Line
Here you will probably have more details of the errors that make the emulator not work fine.
Delete in your Android SDK the directory "libstdc++" in the directory "emulator/lib64". The emulator will use the system libraries now.
I was fiddling around on an issue like this on Fedora 32 for a couple of days.
I had to to make system unload the free nouveau graphics driver and install/load the non free nvidia driver.
Very useful:
https://rpmfusion.org/Howto/NVIDIA
To check which driver is loaded I used:
lshw -c video
It is difficult to grab the correct rpm package from rpmfusion.
If nvidia is not loaded, then you can check:
more /var/log/messages | grep nvidia
It told me which driver series to use.
After successful install of nvidia driver, I can use HW graphics option in AVD manager.
Sometimes killing the qemu process and then relaunching AVD solves the problem.
killall qemu-system-x86_64
I know this is an old thread but the answer that helped me is not in this page:
The problem was that my mother board had the parameter "CPU virtualization" disabled. After I turned it on, the emulator started working.
I had this problem and I discovered that I did not have enough memory to run my avds. To check this, it is best to try run the avds through the terminal:
First: Check the avds you have installed by changing directory (cd) to the tools folder under the Sdk folder in the Android folder:
//to cd to the tools directory from your home:
cd Android
cd Sdk
cd tools
Once in the tools folder, check the avds installed:
$ ./emulator -list-avds
To launch an emulator listed under your installed emulators:
$ ./emulator #complete_name_of_avd
If you have enough memory, you should be able to start your started avd successfully. If not due to memory issues, you will get the information through your terminal. Free up enough memory from your device to ensure you are able to run the avd successfully.
Also, you might want to reconsider testing an app from the virtual emulator as it drags the machine so much. A physical device connected via USB will be much better to use. just ensure that you have enabled debugging on that particular device and you will be able to identify it among the list of options you have for deploying your application.
None of above helped me. For versions 2021.* and 2022.* just disable ipv6. I have no idea what if you really need ipv6 but only this action solved the problem for me.
Check your Linux distro manuals for details how to disable ipv6.

Unable to launch android emulator in Mac

I have been working on an android project, I am using android studio on my iMAC[Software OS X 10.9.5, Graphics Intel HD Graphics 5000 1024 MB, Processor 1.4 GHz Intel Core i5].
When i try to open my application on an android emulator it get this error-
emulator: ERROR: x86 emulation currently requires hardware acceleration!
Please ensure Intel HAXM is properly installed and usable.
CPU acceleration status: HAX kernel module is not installed!
I can find so many similar issues with solution on Google & SO, but i am unable to use those solutions for MAC???
I followed all the steps given here but with no luck, still unable to launch emulator. I think there is something to do with mac os.
Can anyone tell me how to do this on MAC ??
Thanks
First, make sure that the Intel HAXM is up to date. You update it by opening the SDK and selecting it in the list. (As of 2016-07-08, the latests HAXM version is 6.0.3).
Then, on Mac, the Android SDK gets installed at: /Users/username/Library/Android/sdk/, therefore, you will need to run the script as sudo, as follows:
sudo sh ~/Library/Android/sdk/extras/intel/Hardware_Accelerated_Execution_Manager/silent_install.sh
If all goes well, the script prints the message: "Silent installation Pass!"
Then, restart Android Studio and run your app with the desired AVD.
I know I'm late, but here it goes.
Delete all AVD's that you currently have.
Go to Preferences >> Android SDK >> SDK Tools
Uninstall Android Emulator
Restart Android Studio.
Re-install Android Emulator from the same place.
Create a new emulator. And Voila !
What i personally did, in the process of fixing this.
I actually re-installed entire android studio. Followed this
Fixed my $PATH variables. Followed this
Then i tried re-installing Android Emulator, which worked for me.
Hope this Helps.
Problem in my case turned out to my .zshrc where my ANDROID_HOME was exported to a wrong value. Take a look at your .bashrc or .zshrc

I can't install intel HAXM

I installed Android Studio and I had no problems with that. However, when I tried to run the emulator, it said that Intel HAXM was not installed.
So I found the installer, ran it, and it even though it said my laptop supports it, that it was not enabled. I went, enabled the Intel Virtualization Technology (VT-x), but I still got the same message.
I hear something about Hyper-V needs to be disabled, but when I go to Turn Windows features on/off, I cannot find it on that list.
Can someone help me with this?
Alright, so I did everything I could possibly find online, and nothing worked.
So I went to the Intel website, and I downloaded the HAXM installer that they provide (instead of using the one downloaded through Android Studio).
The installation actually went through with this installer and it was installed successfully. Then I open Android Studio, and the emulator finally loaded!
So, for anyone else having this problem, just download the installer directly from the Intel website.
Here's the link:
https://software.intel.com/en-us/android/articles/intel-hardware-accelerated-execution-manager
I think your problem was that you thought that the installer in Android SDK Manager would actually INSTALL the Intel HAXM. But the hook is that it WILL NOT INSTALL it. What it does is extracts the files needed for (really) install Intel HAXM.
I found that out when I got the same problem and then read this in Intel's web page:
Downloading through Android* SDK Manager
... Other steps ...
5) The SDK Manager will download the installer to the "extras" directory, under the main SDK directory. Even though the SDK manager says "Installed" it actually means that the Intel HAXM executable was downloaded. You will still need to run the installer from the "extras" directory to get it installed.
6) Run the installer inside the /sdk/extras/intel/Hardware_Accelerated_Execution_Manager/ directory and follow the installation instructions for your platform.
So all I needed to do was go to folder where my Android SDK was, opened that folder (sdk_location/sdk/extras/intel/Hardware_Accelerated_Execution_Manager) and run the silent_install.bat.
After this when I launched my emulator, it said this:
HAXM is working and emulator runs fast virt mode
and everything works as should!
You can also use some useful parameters with silent_install.bat:
-v Print HAXM version
-c Check VT/NX capability of the platform
-h Print usage
Make sure the emulator is not running while installing HAXM. Otherwise, there will be an error which you only see when using the standalone installer but not within Android Studio or IntelliJ Idea.
dism.exe /Online /Disable-Feature:Microsoft-Hyper-V
or
bcdedit /set hypervisorlaunchtype off
Other things you may need to do:
If using Avast? disable Enable hardware-assisted virtualization under: Settings > Troubleshooting
bcdedit /set nx AlwaysOn
sfc /scannow and reboot
Important: After anything you try, Restart the PC and try to run the HAXM installation again
I faced this problem.I got the solution too.It will work.
Step 1: Go to your BIOS settings and check that INTERNET VIRTUAL TECHNOLOGY is Enabled or Disabled.
And make sure HYPER V is disabled.
To disable it :
a)Go to Control Panel
b)Click on Programs(Uninstall a Program)
c)Then click on Turn Windows features on or off , then look for HYPER-V and untick it. And Restart.
If disabled then enable it.
Step 2: Try to install Intel HAXM now and restart. If It shows same problem again.
go to Step 3.
Step 3: You have to disable Digitally Signed Enforcement. To disable it permanently you have to make sure that Secure Boot option is disabled in your system.
How to check ?
Answer is given in the following link. I found it in Internet.[Thanks whoever made that blog]
link : http://www.windowspasswordsrecovery.com/win8-tips/how-to-disable-uefi-secure-boot-in-windows-8-1-8.html
Step 4: Now restart again.
To disable driver signature enforcement permanently in Windows 10, you need to do the following:
1.Open an elevated command prompt instance.
2.Type/paste the following text:
`bcdedit.exe /set nointegritychecks on`
or Windows 10
`bcedit.exe -set loadoptions DISABLE_INTEGRITY_CHECKS`
Windows 10 disable driver signature enforcement
Restart Windows 10.
*If you somehow want to enable it again:
1.Type/paste the following text:
`bcdedit.exe /set nointegritychecks off`
<==||=====>For me who have an AMD Processor:<=====||==>
1. Click on the windows button in the bottom left hand corner
2. Look for Enable/Disable Windows features
( Just type : "windows features", it will appear)
3. And contrary to the other posts here, enable Hyper-V and Windows Hypervisor Platform
Thanks.
I probably tried all the solutions mentioned above but all in vain.
To summarize, I did:
I enable the virtualization going to BIOS setting.
Uncheck Hyper-V option by going to Turn Windows features on or off.
Download HAXM directly from the website https://software.intel.com/en-us/android/articles/intel-hardware-accelerated-execution-manager and install it.
Uninstall and reinstall Android Studio.
Copy the HAXM from my another system where HAXM was working fine, from the location C:\Users\UserName\AppData\Local\Android\Sdk\extras\intel
Nothing worked for me.
What worked for me:
I noticed the issue "unable to run mksdcard sdk tool" when I try to download SDK platform.So after some research, I found some SDK tools such as mksdcard.exe require Microsoft Visual C++ runtime 2015-2019. So based on my system type,(for me it was x64) I downloaded the latest Microsoft Visual C++ Redistributable for Visual Studio 2019 from the link https://visualstudio.microsoft.com/downloads/.
Detailed answer given here:
Android Studio install failed - unable to run mksdcard sdk tool in Windows
After downloading and installing Visual C++ ,the error "unable to run mksdcard sdk tool" was fixed, also when I try to install HAXM after this, it was install successfully. Everything was fine. I was also able to create AVD now(which was also a problem when HAXM was not install).
How I solved this problem:
Step-1: Downloaded the Android Studio and installed it. But it failed to install HAXM.
Step-2: Then ran the AVD. Then it prompts to create a virtual device. But it also failed.
Step-3: I downloaded the latest HAXM from intel's GitHub source. From here github.com/intel/haxm/releases/latest
Step-4: Then installed HAXM manually. Documentation is here: Installing Standalone Intel HAXM on Windows
Step-5: Then again tried to create a virtual device of Pie. It successfully created it.
But if your Step-5 fails anyhow, there may another solution: When downloading the .zip file, it will show you the SDK path and also the source path of the .zip file. So you can manually download the .zip and can place it to the SDK path folder. Then again can try to create the virtual device.
This is what worked for me -
Enable Virtualiztion through BIOS (F10-> System Configuration -> Virtualiztion Technology)
Depending on your hardware, firmware and BIOS configuration utility the option to enable may be named something else or steps may differ.
There is a free software called "Piriform Speccy" which gives information about your machine, which among other things can also be used to check if virtualization is enabled or not on your machine (see screen cap).
Download HAXM intaller from Intel site. https://software.intel.com/en-us/android/articles/intel-hardware-accelerated-execution-manager
If using avast, disable "Enable hardware-assisted virtualization" under: Settings > Troubleshooting by unchecking.
Do a hard boot (power button) just to be safe.
Option 1: Go to Android SDK Folder --> Extra --> Intel and double click on HAXM installer and install it manually.
Option 2: If you do not have latest version of HAXM then you can open sdk manager in android studio and download it.
Option 3: Download HAXM intaller from Intel site. https://software.intel.com/en-us/android/articles/intel-hardware-accelerated-execution-manager
Download HAXM form this link download HAXM .Unzip it and you will see a msi installer file and install it.Then you will see no longer HAXM is not installed while creating your emulator.
Install Intel HAXM from Github.
It requires you to Disable the Hyper-V technology. To disable it follow instructions from Microsoft website.
You are Good To Go Now.
For HP Ultra book with windows 7 enabling hyper-v through bios worked for intel haxm problem.
For enabling hyper-v:-
F10-> Bios advanced setting-> device configurations->enable Hyper-V then install.
It will work.
I've figured out.
Try to disable Security Boot Control in BIOS options: http://remontka.pro/secure-boot-disable/ (sorry for russian examples)
Or try to start system without Digital signature (only for one loading).
I had had many unlucky attempts with 'HAXM installer, before I disabled this line.
At the beginning I thought that's because Windows 10 Home was installed, and there're many limits.
If Nothing Helps then it means Device Guard and Credential Guard are using the virtualization. I had to disable them by downloading and running the following script from microsoft site.
DG_Readiness_Tool_v3.5.ps1 -Disable
You may need to run this first if it doesn't allow to run the command
Set-ExecutionPolicy Unrestricted
Once you do it, you need to restart and confirm disable both when asked just before boot.
hope it helps!
Note: this is not an answer because I could not find a solution. But I think the information may be useful for others (and it wouldn't be practical as a comment).
I have tried all of the steps detailed in the various docs but I could not get Android Emulator to work on my AMD Ryzen 7 :(
Most answers work only for Intel CPUs.
If you have an AMD CPU (like me, an AMD Ryzen 7) you need to know about some restrictions and you have to use WHPX instead of HAXM.
I found this on MS's site: Because the Android emulator currently supports AMD hardware acceleration only on Linux, hardware acceleration is not available for AMD-based computers running Windows.
Fortunatelly there is a way to make it work but configuring hardware acceleration for an AMD CPU is a bit more complex:
Requirements and recommendations:
- AMD CPU recommendation: AMD Ryzen CPU
- Android Studio 3.2 Beta 1 or higher
- Android Emulator version 27.3.8 or higher
- Windows 10 with April 2018 Update or higher
To use WHPX acceleration on Windows, you must enable the Windows
Hypervisor Platform option in the Turn Windows features on or off
dialog box. For changes to this option to take effect, restart your
computer.
Additionally, the following changes must be made in the BIOS settings:
- AMD CPU: Virtualization or SVM must be enabled.
Note that there are further restrictions as well:
You can't run a VM-accelerated emulator inside another VM, such as a VM hosted by VirtualBox, VMWare, or Docker. You must run the emulator
directly on your system hardware.
You can't run software that uses another virtualization technology at the same time that you run the accelerated emulator. For example,
VirtualBox, VMWare, and Docker currently use a different
virtualization technology, so you can't run them at the same time as
the accelerated emulator.
Some more info: Android Emulator - AMD Processor & Hyper-V Support
This recommendation did not help either:
Please note: More recent versions of the emulator (27.2.8, 27.3.0, or
later), require an emulator flag while the feature is in the preview.
To do this, create or edit the file
C:\Users\.android\advancedFeatures.ini and add the
line “WindowsHypervisorPlatform = on”, or start the emulator from the
command line with “-feature WindowsHypervisorPlatform”.
For me who has an AMD Processor:
Click on the windows button in the bottom left hand corner
Look for Enable/Disable Windows features (just type : "windows features", it will appear)
And contrary to the other posts here, enable Hyper-V and Windows Hypervisor Platform
THE SHORT ANSWER:
Disable Microsoft Defender Application Guard
None of the answers helped me. Also, most of the answers here were addressed elsewhere online. I spent hours trying to solve this problem. After much hesitation, I decided to go on a hunch. I was suspicious about msinfo32.exe showing a Hypervisor was running, but it would not provide additional detail. I went into the services manager. I saw an instance of a hypervisor service was running, I went to disable it. Before disabling, I was asked if I am sure and was informed that a couple of other services would stop. One of the other services was Microsoft Defender Application Guard for Internet Explorer. I disabled this and FINALLY after hours of research on this topic was able to install Intel HAXM for Android Studio on my i5-4430 with Z87 chipset.
It was not enough to merely disable Hyper V and Windows Hypervisor Platform.
It should prompt you to install HAXM when creating a new virtual device:
Tools > Android > AVD Manager
It will install through Android Studio automatically.
If you are using windows then edit your AVD config to ARMEABI image instead of X86, Also using ARM will give better performance. HAXM installer is required only if you use X86 image.
I think that you would install Android SDK files not in (your PC)\Appdata\Local\Android\sdk (default Path). Also there was nothing when you double click 'intelhaxm-android.exe' file.
If it was, Browse (your PC)\Appdata\Local\Temp\intel\HAXM\6.0.3(yyyy-mm-dd_hh_mm_ss) (or silent), then you must see 'hax64' (or hax) file, and simply invoke this file.
Enter with Administrator user.
First, you must enable it
http://www.ghacks.net/2014/11/12/how-to-enable-the-hidden-windows-10-administrator-account/
Install it from C:\Android\sdk\extras\intel\Hardware_Accelerated_Execution_Manager\intelhaxm-andoid.exe
And login with your user. It work for me.
Good description here: https://developer.android.com/studio/run/emulator-acceleration.html
You may check current HAXM status with following command:
sc query intelhaxm
If you use Windows 10 Home, all issues about Hyper-V is irrelevant for you as it is not supported (Pro is required) and you will not have conflicts :)
Remark: trying to update HAXM to latest version incidentally removed it, but then can't update with SDK manager, as it shows that latest version 6.1.1 is unsupported for Windows (seems configuration is broken, found 6.1.1 for Mac and 6.0.6 for Windows only inside)
So would recommend manually download HAXM and install as described:
copy to sdk_location/sdk/extras/intel/Hardware_Accelerated_Execution_Manager and run the silent_install.bat
After some trials, knowing that I had all the factors stated in this thread and other threads properly configured, I still got this error in Android Studio.
Even after installing externally, it seems Android Studio could not discover that HAXM is already installed, unless it gets to install it itself.
As a solution that worked for me, under User\AppData\Local\Android\sdk\extras\intel\Hardware_Accelerated_Execution_Manager which android has downloaded when attempting to install HAXM, click the installer and uninstall the software, then re-try from Android Studio to install it, it should work now.
I tried the following:
1. Directly installed HAXM from Intel
2. Tried multiple times to un-install and re-install Android Studio with same default paths in C drive.
3. Un-install various other software including QEMU which also uses HAXM, which might have been interfering with Android recognizing HAXM.
Solution was:
1. To un-install Android Studio and install it on D drive including the SDK. This solved the problem.
I installed Android Chipmunk 2021.2.1 and tried to install HAXM through the SDK manager. It failed first because I was running an emulator. However, one other thing I noticed is that when you first run the installer, it creates the folder for the HAXM install. Then, when the memory allocation dialog pops up, it tries to create the folder again. Since the folder already exists, it appends a "2" on the end of a new one. What I did is watched the install folder and when it creates the folder the first time I deleted it before continuing. I then continued with the install and it created the folder again and completed successfully. It seems there is a bug in the new SDK installer for HAXM
If you are using windows, Hyper-V works via AMD not HAXM.
Try the following: on Android, Click SDK Manager ==>SDK Platforms ==> Show Packages ==>ARM EABI v7a Systems Image.
After downloading the systems image, go to the AVD Manager ==> Create Virtual Device ==> choose device (e.g. 5.4 FWVGA") ==> Marshmallow armeabi v7a Android6 with Google APIs ==> Change the AVD name to anything (eg. myfirst)==> click finish.
If you have all gone through this and it still doesn't work and "systeminfo.exe" shows hypervisor is detected then disable Containers in Windows Features. After that all went well.
None of the suggestions worked on their own.
Here is what worked for me:
chmod -R 777 $ANDROID_HOME
Then try to install it via android studio -> sdk manager. If its not there, reinstall latest version of Android studio over your current installation. HAXM will show up in SDK manager after that.
If you do not have ANDROID_HOME set, then YOU are part of the problem.
The value of it can be found inside Android Studio project structure. On MAC, just type CMD ; and look at SDK Location on left.
Simply run chmod -R 775

Android Emulator freezes

Until the last SDK release, my Android Emulator worked very nice with x86 architecture, installing Intel HAXM and enabling GPU for the device in AVD Manager.
With the latest SDK release, I reinstalled my Windows (from 8.0 to 8.1), tried both 1.06 and 1.07 Intel HAXM and my app freezes quite frequently.
It doesn't freeze to death, just the freezes/does not updates the screen anymore.
Especially if I'm swiping a ViewPager, then it freezes almost always in between pages.
BUT, if I click a menuitem on the AppBar, it refreshes itself and draws the destination ViewPage page.
I'd appreciate any advice, because right now app development via emulator became ultrapainful.
My emulator froze and I couldn't fix it with the other answers, but this solved it:
Tools->AVD Manager
In the Actions column for your virtual device, click the white arrow on the right and then click Wipe Data.
This will clear the cache for the virtual device.
If your app depends on Google Play services, you will need to update it again
Try this:
In the Android Virtual Device (AVD) settings, select
- edit this AVD, then click
- show advanced setting then
- DISABLE multi-core CPU.
In the Android Virtual Device (AVD) settings, turn off the Use Host GPU emulation option. Unfortunately, the resulting slowness is often worse than the freezing.
Before doing the steps you need to delete the .lock folder under the C:\Users\user\.android\avd\yourEmulatorName\ path, To go there just simply click Show on Desk .Then -
Step 1: Go to AVD Manager and click the drop-down and select Stop. The emulator will be stopped then.
Step 2: Then click the Cold Boot Now
Use the free Visual Studio Emulator for Android. It's very fast, and despite its name, does not require you to work in Visual Studio to use it. Android Studio and Eclipse happily detect it as the running emulator.
Setting Boot option to Cold boot worked like a charm for me. Absolutely no idea why.
Also disabling advanced profiling helped me with older versions (API 21).
What helped me was to use a lower version of SDK in emulator, namely the SDK version 31 (image "S")
Please note the date I'm writing this, if you are seeing this in the future try lowering your version acccordingly
stop the emulator and go to C:\Users\YOUR_USER\.android\avd\Pixel_6_Pro_Edited_API_33.avd and delete
version_num.cache
cache.img.qcow2
cache.img
multiinstance.lock
hardware-qemu.ini.lock
AVD.conf
it will work
Try giving virtual device less RAM.
Android froze on start with 4GB (=4096MB) RAM but did not freeze with 3GB (=3072MB).
Note: I'm using Android Studio on Linux Mint 21.1.
From the Android SDK Manager, install Intel x86 Emulator Accelerator (HAXM installer) revision 5 or later, and then run sdk\extras\intel\Hardware_Accelerated_Execution_Manager\intelhaxm.msi to update the drivers on your PC. This is version 1.1.0 of the accelerator, which seems to fix the freezing bug.
Try this :
sdk\tools\emulator.EXE -partition-size 512 -noaudio -no-boot-anim -avd Nexus5XAPI25 -prop monodroid.avdname=Nexus5XAPI25
After I added -noaudio option,it's ok

Categories

Resources