Android Studio: "The emulator process for AVD Pixel_2_API_30 has terminated." on MacBook Pro M1 (Apple Silicon)
Asked Answered
B

21

58

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

Blondellblondelle answered 9/7, 2021 at 7:23 Comment(4)
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.Harvard
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.Thaumatology
Does this answer your question? Android Emulator issues in new versions - The emulator process has terminatedMacri
This question is similar to: Just updated to Android Studio 4.2.1 on Mac and now emulator no longer works. If you believe it’s different, please edit the question, make it clear how it’s different and/or how the answers on that question are not helpful for your problem. The accepted answer here credits the duplicate.Redroot
F
93

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.

Fiber answered 9/7, 2021 at 7:51 Comment(6)
I already had installed 30.8 of android emulator but was getting errors. After reinstalling it, got working! fantasticSplutter
Didn't work. Tried the exact steps, but it didn't work.Fuegian
I am just learning Android Dev, Im using IntelliJ I have 31.1.4 and still get the same errorsPyuria
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.Numerate
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!Aldo
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.Punctilious
E
29

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

Epigenous answered 12/3, 2022 at 5:32 Comment(0)
E
15

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
Elul answered 4/1, 2022 at 12:46 Comment(1)
I just tried it on my Mac - M1 Pro and it did not workZootomy
R
11

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!!

Rubella answered 21/9, 2021 at 4:35 Comment(3)
Where to check this file ?Fuegian
This was it! For some reason my .zshrc had lines setting ANDROID_HOMECareen
Tried many things, only this worked. However ANDROID_HOME path was there for a reason, right?Ubiety
A
8

I had the same Problems when using API > 29.

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

Android Studio SDK Manager

Anatropous answered 3/8, 2021 at 23:4 Comment(1)
I tried all of the solutions but only this solved the problem. Thanks.Cimon
P
4

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

Period answered 25/1, 2022 at 8:51 Comment(1)
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.Upgrowth
S
4

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.)

Seligmann answered 28/6, 2022 at 18:43 Comment(0)
V
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

Vinaigrette answered 8/2, 2022 at 14:54 Comment(0)
U
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.

Underwriter answered 3/11, 2022 at 8:13 Comment(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 moreChromatics
F
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.

Flinders answered 2/6, 2022 at 17:45 Comment(0)
F
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

Fimbriate answered 21/10, 2022 at 14:4 Comment(0)
A
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

Anderlecht answered 9/12, 2022 at 19:54 Comment(0)
F
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
Foilsman answered 20/1, 2023 at 15:28 Comment(0)
S
1
  • 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

Swearingen answered 20/3, 2023 at 19:43 Comment(0)
H
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.

Herefordshire answered 9/7, 2022 at 11:24 Comment(0)
G
0

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.

Guardi answered 30/8, 2022 at 13:30 Comment(0)
A
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.

Ariew answered 13/2, 2023 at 9:30 Comment(0)
S
0

You can follow the below steps to resolve the AVD

  1. open android studio
  2. open the Android Studio settings.
  3. go to the system settings then select the Android SDK
  4. then go the SDK Tools and choose Android emulator.
  5. wait until progress is not completed .
  6. you can see in the below image also

enter image description here

Slier answered 5/11, 2023 at 10:22 Comment(0)
P
0

There can be multiple reason for this error. To find the reason,

  1. Open the project on Android Studio.
  2. Then Try to run the Emulator. You will receive the error.
  3. Now on the Menu bar, go to help-->Show log in finder enter image description here
  1. Open idea.log file

  2. Try to find the error here : Emulator has terminated.

  3. Then above this error, you can actually find the reason like why it was failing.

In my case, it was due to the wrong Android image I was choosing while creating the emulator. My MacBook M1 didn't support that Image.

Puerperal answered 5/12, 2023 at 15:58 Comment(0)
M
-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

Misdoing answered 17/8, 2022 at 5:16 Comment(0)
A
-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
Acarology answered 2/9, 2021 at 5:29 Comment(1)
This does not provide a solution for the issueNisse

© 2022 - 2024 — McMap. All rights reserved.