ChatGPT解决这个技术问题 Extra ChatGPT

Android Emulator issues in new versions - The emulator process has terminated

After updating to Android Studio 2020.3.1 canary 15, when I try to run an emulator, it gets killed with this error:

The emulator process for AVD Pixel_4_API_30 has terminated.

It was working correctly in the previous version (4.1.3), but now after installing the new one, it shows the same error.

I've tried some solutions had suggested in almost similar cases; however, It still doesn't work.

I deleted my emulator (also I cleared inside of directory: /.android/avd/) and created a new one again I updated the HAXM installer to version 7.6.5 I tried to run an emulator with lower APIs but...

Image of the error:

https://i.stack.imgur.com/vU9N0.png

Can you also add what OS you are using? I have just tried it on MacOS Big Sur 11.3 and it worked. Maybe "Invalidate Caches / Restart" would help.
Not having enough disk space could give the same error message. Best way to find the correct cause is to look into log file at "C:\Users\\AppData\Local\Google\AndroidStudio2020.3\log"
Also, if you just installed Android SDK Studio, rebooting your machine might help, this fixed the issue for me ^^'

A
Anatolii Shuba

The main root cause of that issue is lack of free space on your disk


Do you know how much space do you need to run the emulator? I have 7 GB Free Space and it doesn't work
It depends on emulator type. Several are below from my setup (x86_64): Pixel_5_API_31 - 3.6GB, Nexus_7_API_28 - 2.4GB, Nexus_4_API_22 - 5.5GB, Nexus_5X_API_26 - 5.2GB, Nexus_5X_API_28 - 2.7GB, Pixel_API_21 - 5.6GB
@MauroStancato Failed to work with 1.2GB, worked with 6GB, took 100 MB of space on running. ¯\_(ツ)_/¯
@AnsalAli Lack of space is a main root cause but not the only one. Probably you have faced other root cause
right answer, something had taken almost all of the device internal storage. Recreated a new device with higher internal storage memory solved it, obviously depends on the actual available disk storage your computer has
M
Marcel Hofgesang

Faced this issue after update to arctic fox.

After seeing error message about termination, open android studio logs

("C:\Users\YourUserName\AppData\Local\Google\AndroidStudio2020.3\log\idea.log")

scroll it down and try to find log line with text "Emulator terminated with exit code". Probably, the reason for termination can be found a few lines above this message - for me it was

"Emulator: cannot add library vulkan-1.dll: failed".

If you have the same reason - go to C:\Windows\System32 directory, search here for file called vulkan-1-999-0-0-0.dll and just rename it to vulkan-1.dll (i've made a copy just in case and named it "vulkan-1.dll").

This fixed the issue for me.


I did not have the same issue but the look into the logs lead me to my solution so +1. For anyone interested mine issue was "Emulator: unknown option: -qt-hide-window" so I ran the command without it.
I was missing this file vulkan-1-999-0-0-0.dll . I downloaded it from the web. And copied the file with this name to System32 and also renamed its second copy to vulkan-1.dll and copied it to the same folder. It helped
i got the dll from dll-files.com/vulkan-1.dll.html hope this helps
I didn't have the vulkan-1.dll file, but adding the advancedFeatures.ini file helped: Vulkan = off GLDirectMem = on > stackoverflow.com/a/68416846/10749567
The best solution is to completely skip the use of 'vulkan-1.dll' by adding the advancedFeatures.ini file with: Vulkan=off, GLDirectMem=on | stackoverflow.com/a/68344341/11211041 Then you don't have to download an unknown dll-file...
D
Dharmik Thakkar

Follow below steps to solve the issue:

Go to Tools -> SDK Manager In SDK Manager Go To SDK Tools Tab and untick the Android Emulator and click on Apply. This step will uninstall the Android Emulator.

After uninstallation completes: Again Open Tools -> SDK Manager -> SDK Tools -> Install the Android Emulator by enabling the check or tick on Android Emulator. This step will install the Android Emulator again. After successful installation. Restart Android Studio. Create new emulator device and Run it. This should work.


This method works well, but if you want to avoid reinstalling the Android Emulator, just update it and that will work. I'm using Ubuntu 20.04 and I just updated the Emulator API to the newest version.
d
danyfang

Try to kill the emulator process and then you can reboot.

On Windows, bring out Task Manager and find the emulator process (you can find it starts with qemu-xxx, it might be wrapped inside Android Studio category), then click end task to kill the process.


This did it for me, I think I failed to gracefully terminate the previous emulator and the qemu-xxx process didn't stop
Finally, It worked for me after trying everything like restarting Android Studio and Cold boot emulator etc.
R
Ravi

For Linux (should be similar for windows)

Locate your Sdk/emulator directory

Run ./emulator -list-avds

Note the AVD name form output eg. 'Pixel_2_API_30'

Run ./emulator @Pixel_2_API_30

This will try to launch the emulator with selected device and show errors if any, in my case it was a disk space issue since I was low on home space.

emulator: ERROR: Not enough space to create userdata partition. Available: 5084.121094 MB at /home/user/.android/avd/Pixel_2_API_30.avd, need 7372.800000 MB.

I had plenty of space in other partition/disk, so I changed the AVD location by setting environment variable 'ANDROID_AVD_HOME' to preferred location, post this started the Android Studio and using the AVD Manager recreated a Device, HTH.


This solution works for me to check how much space was I needing developer.android.com/studio/run/….
ERROR: process is translated under Rosetta. Attempting to replace emulator installation
S
Sarthak Raval

This solved the same issue for me:

Open text editor (eg. notepad) Type this code:

Vulkan=off
GLDirectMem=on

Save the file as "advancedFeatures.ini" in .android directory. If your user is named Admin, under windows it would be: C:\Users\Admin\.android\advancedFeatures.ini. Run your app.


Where can I find this directory on MacOS 12.0.1 (Monterey)?
/Users/user/.android, if this file is not available simply create a text file called advancedFeatures.ini and add above mentioned code save it in /Users/user/.android folder(this folder is hidden)
G
Gaurav Khurana

After going through all answers.

This answer can help you finding the root cause. clear the below file and restart the device to know the problem

C:\Users\YourUserName\AppData\Local\Google\AndroidStudio2020.3\log\idea.log"

My problem came as

2021-10-13 19:11:54,776 [1564693]   INFO - manager.EmulatorProcessHandler - Emulator: init: Could not find wglGetExtensionsString! arbFound 0 listarbNull/empty 1 0 extFound 0 extNull/empty 1 0 remote 0 

On further search i found the this which points out changing advanced settings (Ram size) and Graphics configuration

Step 1 :- while setting up device click on advanced settings

https://i.stack.imgur.com/aTENu.png

Step 2 :- Change the 2 setting as highlighted. make it 512 and Automatic to Software GLES

https://i.stack.imgur.com/ZeLqn.png


To find the location of your logs on the Mac, go to Help -> Show Log in Finder
e
enzo

I updated and had the same problem. I solved the problem by changing the Multicore CPU and memory

https://i.stack.imgur.com/5dEaJ.png


Z
ZygD

I faced the same issue. Fixed it by enabling the Hyper-V on my Windows 10 OS. I just typed Hyper in the Start menu and went to Turn Windows features on or off menu and ticked all the Hyper-V checkboxes like this:

https://i.stack.imgur.com/nqNU5.png


Yes, enabling Hyper-V on my Windows 10 64-bit system stopped the "The emulator process for AVD" ... "has terminated" crashes for me too! I'm baffled, because instructions at developer.android.com/studio/run/emulator-acceleration indicate the exact opposite, namely that one should disable Hyper-V instead of enabling it. I had also tried HAXM v7.7.0 from github.com/intel/haxm/releases instead of the HAXM v7.6.5 that was in my <SDK>\C:\Android\extras\intel\Hardware_Accelerated_Execution_Manager folder, but that did not work either, only enabling Hyper-V worked thus far.
P
Peter

To solve these type of issue, generally you haven't some file, that you need to download it from google and paste. I was facing the same issue. but after a lot of time spent on google finally I have got the solution.

Following are the steps:-

Create virtual device using AVD Manager start the emulator if it is showing your emulator has terminated Then go to ("C:\Users\YourUserName\AppData\Local\Google\AndroidStudio2020.3\log\idea.log") check the issue by scroll down(on bottom you can check) If you are getting the same issue Then go to C:\Windows\System32 directory, search here for file called vulkan-1-999-0-0-0.dll If file is already in directory, then just rename the file into "vulkan-1.dll" else download the file from this link you will have zip file, just extract and paste the vulkan-1-999-0-0-0.dll file and perform the step 8.


b
bhw1899

It's an issue of latest Emulator.

I upgraded to v30.6.4 last night and got the same issue.

Please use Genymotion instead before Android Studio Emulator issuing its next update.

It's free for personal use.

https://www.genymotion.com/download/

https://i.stack.imgur.com/wl6QI.png


@IgorLevkivskiy can you explain how to downgrade emulator version?
@basilkot find a download link of an older version and then replace android_sdk/emulator folder with the downloaded one.
I can't find download link of an older version of emulator , I updated to latest which does not work , Can you please provide me with a download link of an older version of emualator ?
I'm a little bit confused... so it's half a year and the main core feature of android studio doesn't work without any official fix? Am I missing something here?
J
Joao Brasil

OK I fixed my problem like the one above by:

I removed the emulator in the AVD manager and reinstalled it. I also deleted the ANDROID_HOME environment variable and it worked again for me in Artic Fox

I am on the latest version of Android Studio Artic Fox 2020.3.1 Patch One on Windows 10 and I upgraded the emulator yesterday 8/18/21 and it completely broke functioning emulators.


j
jaiminkumar patel

I would like to mention something about this,

The mentioned solutions works, however, if none works then please make sure you have sufficient space where AVDs are generated.

If system do not find the enough space to operate, it will give this error too, same as in my case.

If space is not an issue for you then mentioned other solutions must work.


One last thing... Take a look at the Event Log if the Issue is related with Vulkan download and install the Vulkan Runtime: vulkan.lunarg.com
after decreasing internal storage space emulator launched.
A
Arun K Babu

In case if anyone facing this issue. I solved it by:

Go to C:\Users\YourUserName\.android

Create a file named advancedFeatures.ini

Then add the following lines of code in the file: Vulkan = off GLDirectMem = on


h
halfer

My issue is resolved when I changed the CPU/ABI setting from "armeabi-v7a" to "x86_64".

https://i.stack.imgur.com/e4a2V.png


Aren't arm emulators slower than x86_64? (it kind of sort of says so when you select arm while creating virtual device). I use MacBook Pro 2021, M1 Pro
N
Numan Karaaslan

This might sound like a joke but restart the computer maybe? I had some emulator processes hanging in the task manager. Restarted the computer and it worked. Maybe it is an android studio bug.


Worked for me. Restarted Android Studio several times, but still no solution. Restarted the computer and DONE!
S
Shobana Velmurugan

I Remove the Emulator folder from the SDK path and download the new component. It's working fine.


S
Sameer Shelar

In my MacbookPro M1 Pro, The issue was I had selected the x86 image while creating the emulator device.

Changing this setting and using the image from the recommended images resolved my issue.


P
Piyush

I face same kind of issues... After increase free space of machine its working fine...


h
halfer

Was facing similar issue while launching arm64 emulator. I had enough disk space and tried uninstalling the emulator and reinstalling it. But this didn't help.

I was able to figure out the issue by running the below commands:

emulator -list-avds
emulator @NameOfAvd

This assumes you've emulator on the path. Executing the last command showed me the below errors which weren't visible when running from Android Studio:

[4453299712]:ERROR:android/android-emu/android/qt/qt_setup.cpp:28:Qt library not found at ../emulator/lib64/qt/lib
Could not launch '/Users/username/../emulator/qemu/darwin-x86_64/qemu-system-aarch64': No such file or directory

Executing the command emulator @NameOfAvd from the Android/sdk/tools path allowed me to start the arm64 AVD.


S
Sebastian

I was not able to start API_30 devices.

I had to install the latest hardware accelerator version (HAXM v7.7.0) from https://github.com/intel/haxm

Then


Fingers crossed, but upgrading to the latest HAXM v7.7.0 seemed to be the trick for me. So far so good. AVD crashed again the first load but now is loading on the fresh boot.
J
Juliana Melo

After having tested solutions suggested in this forum, the only one which solved the problem to me is to free space in my hard disk. In my case I needed at least 7 GB to make it work.


I had 6GB free, After clearing another 4GB, I was able to run the emulator
r
redballtoy

https://i.stack.imgur.com/B9dh6.jpg


F
FlutterCyber

I select configuration of the emulator graphics "Hardware-GLES 2.0", it worked


k
kirkadev

Open "Edit this AVD". In the section "Emulator Performance" change Graphic type to another (for example, Software - GLES 1.1).

I have an old video card and this is work in my case.


the dropdown list is disabled, I cannot change to anything else.
S
Suresh Chaudhari

If emulator is terminating and it was properly running earlier and even if you have enough disk space. You can delete and create a new Virtual device which is almost same as "Wipe Data" action on existing Emulator. But if you do not want to wipe data and loose any kind of progress made on the Emulator, There is a "Cold Boot" option for you which helps. It actually solved the problem for me.


J
Jimmy

For those who running flutter/Dart in android studio. Here are the step on how I solved this:

Go to any of your current device in Device manager. Click the edit icon (Pen Icon). Then dialog for edit will open. Now change the "Graphics" property in the AVD under Emulated Performance from automatic to "Software-GLES 2.0". it works for me.

Note: Am using android studio Bumblebee | 2021.1.1 patch 2


J
Jack

Check if your disk space of computer is full or not. In my case C:// was full


G
Ged Flod

This error also occurs when there is not enough free space left on your computer. be sure to free up some more space.

$ emulator -avd phone2

ERROR   | Not enough disk space to run AVD 'phone2'. Exiting... 

A
Adrian

In Windows, open the Task Manager and kill the process "qemu-system"