Reputation: 3579
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?
Upvotes: 59
Views: 111876
Reputation: 1253
There can be multiple reason for this error. To find the reason,
Open idea.log file
Try to find the error here : Emulator has terminated.
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
Reputation: 425
You can follow the below steps to resolve the AVD
Upvotes: 0
Reputation: 163
~/Library/Android/sdk/system-images
folder.solved my issue
Upvotes: 1
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
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
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
Reputation: 554
Sometimes it happens due to lack of storage. Make free space in your hard disk.
Upvotes: 32
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
Reputation: 11
deleting these files :
and restarting android studio solved the issue for me
Upvotes: 1
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
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
Upvotes: -1
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
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
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
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
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
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
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
Reputation: 1
Upvotes: -7
Reputation: 99
I had the same Problems when using API > 29.
So I installed the SDK Platforms API 29 and it worked.
Upvotes: 8
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