57

I have a problem to start an Android Emulator on my MacBook Pro M1 (Apple Silicon). When I try to start an emulator (API 30, CPU/ABI arm64), I get this error: "The emulator process for AVD Pixel_2_API_30 has terminiated."

I'm using 2020.3.1 Beta 5 of Android Studio.

Does anyone know how to solve this problem?

Error Message when starting an Android Emulator

Nils Reichardt
  • 3,195
  • 2
  • 18
  • 28
  • Had the same problem in Android Studio 2020.3.1 (non-beta) on Ubuntu. Turned out the disk partition containing `~/.android/avd` was full, so had to move+symlink it to a another partition with more space available. – Joel Purra Oct 13 '21 at 15:05
  • Had the same problem in Android Studio 2020.3.1 on Windows. Turned out the environment path `ANDROID_HOME` is occupied by scoop, a package manager in Windows, which will set the path automatically when install android-sdk, free the path by uninstall android-sdk package. – attolee Nov 10 '21 at 13:11
  • Does this answer your question? [Android Emulator issues in new versions - The emulator process has terminated](https://stackoverflow.com/questions/67346232/android-emulator-issues-in-new-versions-the-emulator-process-has-terminated) – Bink Jan 19 '23 at 23:36

19 Answers19

88

It would seem due to the fact you are using a beta version of android studio the message "The emulator process for AVD Pixel_2_API_30 was killed." has been changed to "The emulator process for AVD Pixel_2_API_30 has terminated." but fundamentally they should still have the same solutions the most common solution being:

"All of the answers are too confusing to follow. Replace SDK or upgrade OS. The quickest way I found is to:

Tools > SDK Manager > SDK Tools

De-select Android Emulator, then click Apply. - The Android Emulator will be deleted.

Now, by default the Emulator version shown will be 30.6.5. Select the checkbox and click apply. This version of emulator will be installed.

That is it, just 2 minutes of you time.

Update: 1 Jul 2021 Issue solved with latest Emulator version 30.7.5"

Credits to: Karan Sharma in the post found here

If this does not fix the error then there are a multitude of different solutions that can be found by googling "Android studio MacBook emulator process for AVD was killed." or simply downgrading/upgrading your emulator works too, because it is a common issue with the v30.6.x emulator versions.

Joseph Saunders
  • 1,016
  • 7
  • 8
  • 2
    I already had installed 30.8 of android emulator but was getting errors. After reinstalling it, got working! fantastic – Mehrdad Shokri Sep 06 '21 at 11:09
  • 12
    Didn't work. Tried the exact steps, but it didn't work. – Ali Raza Nov 10 '21 at 07:34
  • I am just learning Android Dev, Im using IntelliJ I have 31.1.4 and still get the same errors –  Nov 30 '21 at 00:09
  • 4
    In my case I was just running out of disk space. As soon as I changed the paths for the SDK and AVD to another drive it started working. – Franke Dec 11 '21 at 05:59
  • I was seeing this issue because I was on an M1 and for some reason, it had installed the emulator tools for an intel Mac. Following these steps fixed that as well. Thanks @Joseph Saunders! – Clark Sandholtz Mar 22 '22 at 18:43
  • I tried to uninstall the emulator and reinstall it. Since it was still running at the time, the uninstall failed. Interestingly HAXM seemed to uninstall, successfully, though, and when I reinstalled it, the error was fixed. I think there's a deeper underlying issue here and that the uninstall/reinstall sledge hammer fixes. – Code-Apprentice Apr 10 '22 at 14:57
26

Sometimes it happens due to lack of storage. Make free space in your hard disk.

siva636
  • 16,109
  • 23
  • 97
  • 135
ARAVIND RAJ
  • 486
  • 5
  • 11
14

Believe me you are not gonna trust me. I am just faced this issue in my windows machine. Nothing was worked. I am wasted my two days to solve this error but no result. Then I just try this solution And boom It worked.

You just need to Create the file ~/.android/advancedFeatures.ini (for Windows users path should be C:\Users\Dane\.android\advancedFeatures.ini) with the following content:

# Here's how to disable Vulkan apps to talk to the emulator.

# Add the following lines to ~/.android/advancedFeatures.ini (create this file if it doesn't exist already):

Vulkan = off
GLDirectMem = on
ShraOne Devade
  • 199
  • 1
  • 5
9

I had the same Problems when using API > 29.

So I installed the SDK Platforms API 29 and it worked.

Android Studio SDK Manager

Faj5097
  • 101
  • 1
9

Please check your .zshrc file in Mac (edit it by usign vim ~/.zshrc command) and remove any manually added path to ANDROID_HOME. Android studio should not have any conflicts with your existing Android paths.

If you are not using .zshrc file then it may be .bashrc file.

Once removed restart your Android Studio and avd. This worked like a magic!!

AmanDeepSharma
  • 2,138
  • 4
  • 20
  • 34
3

Although this question has already being answered, I want to add how I've fixed this issue.

For me, I've to clean up all the data -

# Deletes All Android Studio related preferences
rm -Rf ~/Library/Preferences/Google/AndroidStudio*
rm -Rf ~/Library/Preferences/AndroidStudio*

# Deletes the Android Studio's plist file
rm -Rf ~/Library/Preferences/com.google.android.*

# Deletes the Android Emulator's plist file
rm -Rf ~/Library/Preferences/com.android.*

# Deletes main plugins 
rm -Rf ~/Library/Application\ Support/Google/AndroidStudio*
rm -Rf ~/Library/Application\ Support/AndroidStudio*

# Deletes all logs that Android Studio outputs
rm -Rf ~/Library/Logs/Google/AndroidStudio*
rm -Rf ~/Library/Logs/AndroidStudio*

# Deletes Android Studio's caches
rm -Rf ~/Library/Caches/Google/AndroidStudio*
rm -Rf ~/Library/Caches/AndroidStudio*

# Deletes older versions of Android Studio
rm -Rf ~/.AndroidStudio*

#Delete gradle files
rm -Rf ~/.gradle/

#Delete Android SDK tools
rm -Rf ~/Library/Android*
rm -Rf ~/.android

By running these command in terminal. Then I open Android Studio and download SDK and voilà It works

mefahimrahman
  • 197
  • 2
  • 6
  • 29
  • I did this, but still unable to reinstall emulator. WTF, I just did remove the emulator attempting to install it again, impossible. The final fix was to trash the entire Android Studio app bundle and install it again from a previous download. – tontonCD Aug 15 '22 at 23:16
3

I think this will helps. uninstall "Intel x86 Emulator Accelerator (HAXM installer)" and reinstall it.

Tools -> SDK Manager -> SDK Tools

credit https://www.youtube.com/watch?v=PFNDx2wdO4A&t=77s

2

I was trying to use emulators I had set up on my old Intel Mac and migrated to an Apple Silicon machine. I believe those x86 emulators won't run on Apple Silicon. I can only use new emulators set up with arm64 system images.

(Unfortunately in my case, I mainly use emulators to test very old Android versions, and the arm64 images are only available back to Android 6.)

arlomedia
  • 8,534
  • 5
  • 60
  • 108
2

android studio emulator process termination may have many reason. check log file on windows OS in

c:\users\<userName>\AppData\local\Google\AndroidStudio-<version>\log\idea.log

to find that error reason. in my case first it was for wrong ANDROID_HOME and ANDROID_SDK_ROOT path in system variables and then it's need more space in hard drive to lunch.

  • 1
    This is the best answer as it is not limited to one specific error. If you can investigate and add the log location for other systems it would improve your answer even more – G.G Nov 08 '22 at 10:16
1

I was having this issue on Windows. None of the proposed solutions worked. What did end up working was terminating the currently running adb.exe process. After killing it I was able to run AVD.

Sleewok
  • 153
  • 8
1

I think, this happened due to shortage of memory in your system. Try to free some memory and try again. Hope, this error will disappear.

Muhammad Awais
  • 141
  • 1
  • 5
1

deleting these files :

  1. /Users/UserName/.android/avd/Pixel_3a_API_24.avd/hardware-qemu.ini.lock
  2. /Users/UserName/.android/avd/Pixel_3a_API_24.avd/multiinstance.lock

and restarting android studio solved the issue for me

1

In my case, I had 2 errors that made AVD terminated first, I changed the default size on the disk from 512 Mb to 8GB second, my emulator sd path contains Russian word which was incompatible for Android Studio to read and make AVD run

Anorov Hasan
  • 123
  • 2
  • 2
1

Running this sudo open -a /Applications/Android\ Studio.app on M1 works for me, seems like a permission issues.

I was able to see that in the idea.log:

2023-01-20 10:20:56,501 [ 217985]   INFO - #c.a.t.i.a.AvdManagerConnection - ~/.android/avd/Pixel_2_API_31.avd/hardware-qemu.ini.lock not found for Pixel_2_API_31
2023-01-20 10:20:56,501 [ 217985]   INFO - #c.a.t.i.a.AvdManagerConnection - ~/.android/avd/Pixel_2_API_31.avd/userdata-qemu.img.lock not found for Pixel_2_API_31
0

I just changed hardware and moved my setup to M1 and immediately started facing this issue.

Upgraded Android Emulator from 30.5.4 to latest(31.2.10) and had my Android Emulator with API level 31 come up again as normal.

rasulfahad
  • 443
  • 3
  • 13
0

In my case, I was not using the "native" android sdk but another sdk I had retrieved from Unity. Using the "native" sdk fixed my problem.

diAz
  • 478
  • 4
  • 16
0
  • Deleting previous images under ~/Library/Android/sdk/system-images folder.
  • Creating new device (Tiramisu Extention Lvl 5, under ARM images with Pixel 3a)

solved my issue

-1

This can be issue of storage ,it needs at least 2Gb of storage(you can free the storage in storage settings in windows) or to get to the exact problem see logs(path C:\Users\<USER>\AppData\Local\Google\AndroidStudio2021.2\log and open it in txt form) you can see the error. The best way is to pair your mobile phone and test it directly on your mobile phone

1

vimuth
  • 5,064
  • 33
  • 79
  • 116
Darkone
  • 1
  • 5
-6
  1. Download Android Studio for Mac (64-bit, ARM) https://developer.android.google.cn/studio?hl=id#downloads
  2. Copy Android Studio.app in your apps directory
  3. create mobile
Stefano Sansone
  • 2,377
  • 7
  • 20
  • 39