[android] ERROR Android emulator gets killed

After updating to Android Studio 2 when I try to run my application and choose an emulator, I wait for the emulator to start and it suddenly gets killed. I can see emulator process for some minutes but never the gui. In Android studio I get the error

android studio Error while waiting for device: The emulator process for AVD was killed

This happens even if I run the emulator outside Android Studio. I have tried with both aa Android 6 and Android 4.4 based emulator. Running on a Windows 7 x64 PC. Similar post to another stackoverflow post which was closed. I have tried various ram, vm heap and resolution settings.

This question is related to android android-studio android-emulator

The answer is


I hit this issue trying to run Android API 30. In the end, I had to upgrade Android Emulator to 30.1.5 (it was 30.1.2 before this).

Android SDK Tools settings


For me it was a problem of available space left in my computer and deleting unnecessary files solved the problem. Causes are vary from situations and you should see event tab which detailed event log are showed.


For my case i need to close Virtualbox


Update your Android SDK via Android SDK Managager. It will probably work fine!


For Android Studio v4.1 and above:

Menu -> Android Studio -> Preferences -> Tools -> Emulator

Uncheck Launch in a tool window option.

enter image description here


For me, just deleting ANDROID_SDK_HOME from the environment variable list solved the problem


If you're on the Apple Silicon (M1) chip, make sure you're using an ARM64-based emulator:

enter image description here

If you're not, create a new Virtual Device and use the arm64-v8a image from Other images.


Please check your free space on your disk also. I had a same problem and finally I got I need to free up space to fix this.


My case was: GOOGLE PLAY.

My virtual device was Pixel 4... As shown on pic, Pixel4 has Google Play support, so that it give this error: " The emulator process for AVD Pixel4 was killed." It gives error on Android Studio 4.1.1.

So that, I created a new virtual device(Pixel 4XL) and selected "SOFTWARE" for emulated performance...

Because this device doesnt have Google Play support, it worked for me.

GOOGLE PLAY SUPPORT SOFTWARE MUST BE SELECTED


I tried to edit AVD with a new System image and voila! it worked! I had Nexus 5X API 24


In my case, the problem was resolved after I tried a lower version of Pixel and Android.


Check the free space of the emulator installation drive is more than 5 GB


For me I was running Arm instead of x86. Solved by installing the correct Image (x86_64 for example).


This worked for me:

Tools -> SDK Manager -> SDK Tools (tab) -> Deselect 'Android Emulator' -> OK

Now, when you try to run your app, or launch device from AVD Manager, it will give the 'Install Emulator' error -> Click Ok. This will automatically download the correct version.


I reinstalled the Intel x86 Emulator Accelerator (HAXM installer)

Prior to that I tried many things, but only one worked:

Configure-> Settings -> Appearance & Behavior\System Settings\Android SDK -> SDK Tools (tab) -> Deselect 'Intel x86 Emulator Accelerator (HAXM installer)' -> OK

Now, when you try to run your app, or launch device from AVD Manager, it will give the 'Install Emulator' error -> Click Ok. This will automatically download new 'Intel x86 Emulator Accelerator (HAXM installer)' and I selected 512 RAM and it worked.

After that I did all these process again and selected 2 GB of RAM and it still worked.


If you use McAfee Antivirus and Windows 10 this might help you:

Uninstalling and reinstalling Android Emulator as snehatilak suggested initially helped in my case, though the next day the emulator was dead yet again.

I found that McAfee antivirus had quarantined the file AVD.conf that had been in C:\Users[username].android\avd[avdImage]\

After restoring AVD.conf and excluding it from scans it seems to be ok again.

This all started 02.02.2021 after what I guess was an McAfee update.

Here are the steps:

First go to 'Quarantined items' under Settings and restore the AVD.conf file enter image description here

Then go to 'Real-Time Scanning' under Settings and exclude AVD.conf in each emulator you have created. (Located under C:\Users[username].android\avd[avdImage])

enter image description here


  • Go to: Tools > Android > AVD Manager and Press the "edit" (pencil) icon next to your AVD , Change "Graphics" to "Software".
  • work on my Windows 10 machine and ubuntu 18.04

If your HAMX is installed and turning to Software didn't help try to check if virtualization is enabled in BIOS. You need to go to BIOS and enable it


Go to SDK Manager and see if there are any updates on the emulator & build tools that need to be updated.


To summarize the above:

  1. Install and reinstall HAXM 7.5.6 (only available version) under 'Android SDK' settings. Try downloading it manually, even other versions (they don't work with Android SDK), installing it from the Android/Sdk folder, etc. sc query intelhaxm in cmd should show if it is running correctly.
  2. Virtualization is enabled in your BIOS and has been tested
  3. Made sure the PATH variables are correct (ANDROID_HOME / ANDROID_SDK_ROOT) but NOT (ANDROID_SDK_HOME) to the folder in your settings per Here. Otherwise, you will see EVENTS on the Android Studio splash screen.
  4. Try unchecking / rechecking Launch in a tool window in Emulator settings (and even Enable Device Frame in AVD settings)
  5. Try rebuilding in several different combinations of android, different phones, etc (but with same levels and packages ... 30 for example)
  6. Try Rebooting in several different configurations
  7. Make sure all SDK Tools are up-to-date, and even try a fresh install of Android Studio. However, tried removing all of them, and adding them back.
  8. Check your space, try to have 25GB maybe or more free
  9. Check for Virtual Box, Antivirus Software, etc.
  10. Open Android Studio with Administrator privileges

RUNNING ON DUAL MONITORS / DOCKING STATION ?

A) Run the emulator with everything unplugged, then plug back in your monitor! (Odd I know)... OR Better yet...
B) Create a New Hardware Profile, which will enable you to change Graphics: Automatic to Software.


This issue happens when you have two Android SDK installations on your machine and the environment variable "ANDROID_HOME" points to the wrong location.

To fix it go to Android Studio settings, find the proper Android SDK location, update the environment variable and restart Android Studio / your PC.

enter image description here


For me it seems it was a problem that OpenGL didn't work on my Windows 10 machine. I fixed it as follows:

  1. Go to: Tools > Android > AVD Manager
  2. Press the "edit" (pencil) icon next to your AVD
  3. Change "Graphics" to "Software".

Install the Intel x86 Emulator Accelerator worked for me.

enter image description here


If your username is not in English then this may help, as I tried all of the solutions here and couldn't fix this problem:

Note: I found this solution on this video, suggested by a user called "tatachka", this is her comment (she kindly let me share it here).

For example, I had this path c:\Users\????.android\avd\Nexus_One_API_24.avd My name in Windows is ????, written in Cyrillic in windows encoding (cp1251). I changed the path to e:\Distribu\AVD.android\avd\Nexus_One_API_24.avd I moved files from disk C there and edited Nexus_One_API_24.ini changing the path in it and everything worked.

How to change the folder path: My computer -> properties -> advanced system parameters -> environment variables - > lower 'New...' button: variable name: ANDROID_SDK_HOME variable value: e:\Distribu\AVD (in my case)

After the reboot, a new folder(.android) appears in the folder e:\Distribu\AVD containing the 'avd' folder

EDIT: For clarification, the idea here is that you don't want the path to have non-ascii characters. I moved it to C:\programs_that_cant_read_hebrew (and preformed the other steps) and it worked just fine.


You need to update the following tools.


I had same issue, the problem was there is no enough space in my disk drive.. you can see details about you specific situation in layer 'Event Log' this layer regularly is in the bottom on Android studio, it was my output Log:

"02:45 PM Emulator: emulator: ERROR: Not enough space to create userdata partition. Available: 3310.363281 MB at /home/user/.android/avd/my_Nexus_5X_API_27.avd, need 7372.800000 MB."

I had just 7 GB free, so just delete some GB's in my D.D. and it's working fine.


Hello Everyone in Android programming... I have same issue Android emulator gets killed but get rid of this issue successfully and android emulator run properly by doing following things...

  1. Firstly, I updated my SDKs from android studio SDK manager but issue does not resolved.
  2. Secondly, I have faced problems regarding my computer C Drive space where path of SDK folder is located. My C Drive space is running very low and does not allow me to update SDK from android studio showing me error and my Android emulator gets killed then I moved my SDK folder from C Drive to another drive D which have huge space available, then Changed my sdk folder path form android studio and restart it and matter resolved successfully. Cheers...
    Best Regards

It's happened to me before. It should solved now by upgrading to Android Studio 4.1.1

Please ensure you all these ticked on SDK tools

  • Google Play Intel x86 Atom System Image
  • Android Emulator
  • Android SDK Platform-Tools & Build-Tools

Restart the Android Studio. it seems work


Best 5 options to resolve this Error the emulator process for avd was killed

given option are checkpoints, check it out one by one.
Error Solution Option 1
Possiblity:
HAXM may not installed in System
HAXM - Hardware Accelerated Execution Manager
Solution:
SDK Manager > Check for HAXM installer
install it, if HAXM not installed
=======================================

Error Solution Option 2
Possiblity : 
Low disk size to load Emulator
Latest AVD with API level 30+ required approx 7 GB disk space
Solution:
Free space from disk where AVD is located

=======================================
Error Solution Option 3
Possiblity :
Configured AVD API may not available in SDK Manager
As an Example:
if Emulator with API level 30, same package of API 30 should be installed in SDK

Solution:
Install same version of SDK Platfrom from SDK manager,
as same as Emulator – AVD API

=======================================
Error Solution Option 4
Possiblity :
Configuration error in Old AVD 

Solution:
Recreate AVD with latest available update
Help > check for update, if component Android Emulator Update is available, install it
delete older AVD and create Fresh AVD

=======================================
Error Solution Option 5
Possiblity :
Embedded AVD not properly load with available image

Solution:
Launch AVD as independent component,
After success close it and lauch within Android Studio
Emulator inside Android Studio
=======================================

before apply all of above once restart you System, try it.

for more help with video support, watch How to fix AVD was killed i think it may help you.


I had same issue. I changed ANDROID_HOME path on environment variables. And then I copied 'avd' folder, which emulator installed in into 'sdk' folder(ANDROID_HOME path). *** You can find 'avd' folder by clicking 'Show on Disk' in AVD manger. I restarted the emulator and then it is running well now.


I think this is problem of Android studio 2 Update or Problem to solve please Update also Android sdk version also then work properly.


I have been struggling with the The emulator process for AVD Pixel_2_API_30 was killed for a while now. I was trying to launch a Pixel 2 API 30 running android 11.0, I tried all the possible solutions but nothing seemed to work. I decided t use a different setup e.g. Pixel 2 API 28 running android 9.0, and it worked perfectly. I am not sure what causes the bug in the higher-level API or android version though... So my suggestion is to change the API and android version IF all of the other solutions didn't work.


goto tools>android>sdkmanager and update emulator and install related API level.It worked for me


Reinstalling android studio worked for me.


Faced a similar issue, tried the above solutions as well and it didn't work.

Would like to suggest a simple solution which could help if the above suggestions didn't address the issue.

Solution - Try cleaning up space in the system. My problem was I had only 1GB left while trying to launch the emulator after cleaning up space got 8GB and was able to launch the emulator.


I also had problem like this.. and how i fixed that:

  • 1. I choosed one of the older version for Android VDM(System image) - first,I used a version 28(Oreo i this it was) after that I switched to older one , to 25(Nougat)..

  • 2. I just change "Graphics" to "Software".


I changed Graphics to Software, Intel x86 Emulator was already installed and also restarted the PC. Nothing worked. It was the Hyper-V issue. I had turned it off for VMWare. I turned it on and restarted the PC and emulator worked. So please try Hyper-V.


None of these answers worked for me. I just created a new Virtual Device with the same exact settings and deleted the old one. New one worked fine.


Tried all solutions didnt help. My solution just create new device and it will work


In my case, after installing the Microsoft Visual C++ Redistributable for Visual Studio 2015, 2017 and 2019 (both x86 and x64 version), the issue is solved.

But wait! Why did I know this? I will tell you my experience.

When your program meets a bug, the first thing you need to do is finding the log to debug. But where is the log file that records all the events of the Android emulator? Click Help?Show log in Explorer. And then a new window is oepned, where a file called idea.log is located, and that log file is what we are looking for.

But this file may has recorded too much verbose info, so let's do following processes to get a more simple one:

·Exit Android Studio

·Delete the idea.log

·Open Android Studio

·Click Tools? AVD Manerger

·Start one of emulators you have created, and needless to say, the error will occur again. But the idea.log will be created and the error is recorded into the log file now!

·Exit Android Studio.

·Open the idea.log and begin to analyze it.

·Search "emulator", and in my case there are 2 messages catching my eyes:

INFO - manager.EmulatorProcessHandler - Emulator: E:\cache\SDK\emulator\emulator.exe -netdelay none -netspeed full -avd Nexus_5_API_22 

INFO - manager.EmulatorProcessHandler - Emulator: Process finished with exit code -1073741515 (0xC0000135)

Obviously, the "exit code 1073741515" is something important, and actually many people have asked what it means in StackOverFlow, but unfortunately, I can't find any useful info about it. So let's pass it and focus on the first message.

Open the command line (Press "Win"+"R" ? Enter "CMD" ? Click "OK"), copy the above message E:\cache\SDK\emulator\emulator.exe -netdelay none -netspeed full -avd Nexus_5_API_22 and paste it to the command line. Press Enter.

I totally didn't know what this command meaned, but it's reasonable to deduce that Android Studio ran this command and resulted in the error, so I will try to reproduce the issue.

After that, an error window pop up, saying "...VCRUNTIME140_1.dll is missing...". I know I have been close to the answer. So I serch "VCRUNTIME140_1.dll Missing" on google, and people said that "downloading and installing both the x86 and x64 versions of the Microsoft Visual C++ 2015 - 2019 Redistributable will resolve this problem".

So I download both the x86 and x64 version and install them. After doing this, I run the emulator again, and everything goes well.


In android studio version 4.0 (WINDOWS), I could find the solution by just checking android studio welcome screen and clicking on the "Events" dropdown AFTER trying to launch the emulator (hence after getting the error): enter image description here

the events section clearly shows that ANDROID_SDK_ROOT was not set in my system.

In a nutshell, whenever you see such error when starting the emulator, just check the "events" section in the welcome to android studio screen to find the real problem.

Beware that if ANDROID_HOME is not set properly, it will still tell you that ANDROID_SDK_ROOT is broken.


this issue can also happen when ANDROID_SDK_HOME environment variable is pointing to wrong location

Say path to .android folder is E:\Android\.android

Then ANDROID_SDK_HOME environment variable value should be E:\Android


Examples related to android

Under what circumstances can I call findViewById with an Options Menu / Action Bar item? How to implement a simple scenario the OO way My eclipse won't open, i download the bundle pack it keeps saying error log getting " (1) no such column: _id10 " error java doesn't run if structure inside of onclick listener Cannot retrieve string(s) from preferences (settings) strange error in my Animation Drawable how to put image in a bundle and pass it to another activity FragmentActivity to Fragment A failure occurred while executing com.android.build.gradle.internal.tasks

Examples related to android-studio

A failure occurred while executing com.android.build.gradle.internal.tasks "Failed to install the following Android SDK packages as some licences have not been accepted" error Android Gradle 5.0 Update:Cause: org.jetbrains.plugins.gradle.tooling.util This version of Android Studio cannot open this project, please retry with Android Studio 3.4 or newer WARNING: API 'variant.getJavaCompile()' is obsolete and has been replaced with 'variant.getJavaCompileProvider()' Flutter plugin not installed error;. When running flutter doctor ADB.exe is obsolete and has serious performance problems Android design support library for API 28 (P) not working Flutter command not found How to find the path of Flutter SDK

Examples related to android-emulator

flutter run: No connected devices How to remove the Flutter debug banner? Android Studio AVD - Emulator: Process finished with exit code 1 Android Studio Emulator and "Process finished with exit code 0" Run react-native on android emulator ERROR Android emulator gets killed Error while waiting for device: Time out after 300seconds waiting for emulator to come online Unfortunately Launcher3 has stopped working error in android studio? updating Google play services in Emulator Android Studio emulator does not come with Play Store for API 23