Nils Reichardt
Nils Reichardt

Reputation: 3579

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

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

Upvotes: 59

Views: 111876

Answers (21)

Akshay Chopra
Akshay Chopra

Reputation: 1253

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.

Upvotes: 0

Rishita Joshi
Rishita Joshi

Reputation: 425

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

Upvotes: 0

Mustafa Candan
Mustafa Candan

Reputation: 163

  • 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

Upvotes: 1

diAz
diAz

Reputation: 506

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.

Upvotes: 0

Hector Rodriguez
Hector Rodriguez

Reputation: 11

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

Upvotes: 1

Anorov Hasan
Anorov Hasan

Reputation: 183

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

Upvotes: 1

ARAVIND RAJ
ARAVIND RAJ

Reputation: 554

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

Upvotes: 32

mojtaba shojai
mojtaba shojai

Reputation: 21

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.

Upvotes: 2

Anand Mukut Tirkey
Anand Mukut Tirkey

Reputation: 11

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

Upvotes: 1

Muhammad Awais
Muhammad Awais

Reputation: 169

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.

Upvotes: 0

Darkone
Darkone

Reputation: 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

Upvotes: -1

rasulfahad
rasulfahad

Reputation: 624

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.

Upvotes: 0

arlomedia
arlomedia

Reputation: 9051

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

Upvotes: 4

Sleewok
Sleewok

Reputation: 153

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.

Upvotes: 1

Fissha Lijalem
Fissha Lijalem

Reputation: 41

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

Upvotes: 3

mefahimrahman
mefahimrahman

Reputation: 349

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

Upvotes: 4

ShraOne Devade
ShraOne Devade

Reputation: 229

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

Upvotes: 15

AmanDeepSharma
AmanDeepSharma

Reputation: 2208

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

Upvotes: 12

  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

Upvotes: -7

Faj5097
Faj5097

Reputation: 99

I had the same Problems when using API > 29.

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

Android Studio SDK Manager

Upvotes: 8

Joseph Saunders
Joseph Saunders

Reputation: 1195

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.

Upvotes: 94

Related Questions