AVD Manager: The emulator process for AVD was killed. Android Studio 4.1.3 and MacOS High Sierra 10.13.6

Viewed 21504

I receive the error in object. I tried to do all the checks (all upgraded and proper installed) but I continue to have the error:

AVD Manager:

The emulator process for AVD was killed.

AVD Manager: The emulator process for AVD was killed.

Here are the details of the emulator:

Name: Pixel_3a_API_30
CPU/ABI: Google Play Intel Atom (x86)
Path: /Users/simone/.android/avd/Pixel_3a_API_30.avd
Target: google_apis_playstore [Google Play] (API level 30)
Skin: pixel_3a
SD Card: 512M
fastboot.chosenSnapshotFile: 
runtime.network.speed: full
hw.accelerometer: yes
hw.device.name: pixel_3a
hw.lcd.width: 1080
hw.initialOrientation: Portrait
image.androidVersion.api: 30
tag.id: google_apis_playstore
hw.mainKeys: no
hw.camera.front: emulated
avd.ini.displayname: Pixel 3a API 30
hw.gpu.mode: software
hw.ramSize: 1536
PlayStore.enabled: true
fastboot.forceColdBoot: no
hw.cpu.ncore: 4
hw.keyboard: yes
hw.sensors.proximity: yes
hw.dPad: no
hw.lcd.height: 2220
vm.heapSize: 256
skin.dynamic: yes
hw.device.manufacturer: Google
hw.gps: yes
hw.audioInput: yes
image.sysdir.1: system-images/android-30/google_apis_playstore/x86/
showDeviceFrame: yes
hw.camera.back: virtualscene
AvdId: Pixel_3a_API_30
hw.lcd.density: 440
hw.arc: false
hw.device.hash2: MD5:0e6953ebf01bdc6b33a2f54746629c50
fastboot.forceChosenSnapshotBoot: no
fastboot.forceFastBoot: yes
hw.trackBall: no
hw.battery: yes
hw.sdCard: yes
tag.display: Google Play
runtime.network.latency: none
disk.dataPartition.size: 2G
hw.sensors.orientation: yes
avd.ini.encoding: UTF-8
hw.gpu.enabled: yes
9 Answers

When emulating on a M1 Mac you need to select a system image from the "Other Images" Tab. Make sure you take a arm64 image.

There is also a preview-repo from google regarding M1-emulation.

enter image description here

Fix: Follow the guide here Codesign QEMU. Use /Users/<username>/Library/Android/sdk/emulator/qemu/darwin-x86_64/qemu-system-x86_64 as the directory for qemu (might be different).

The issue I had was with qemu-system-x86_64. Running the emulator in terminal would show this error: cannot add library /Users/<username>/Library/Android/sdk/emulator/qemu/darwin-x86_64/lib64/vulkan/libvulkan.dylib: failed.

To fix it I found these posts: Reddit Codesign QEMU

UPDATED - 28/4/2021

  1. create entitlements.xml file with the following content:

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
        <key>com.apple.security.hypervisor</key>
        <true/>
    </dict>
    </plist>

  1. and run on qemu path as necessary where your SDK is located.
codesign -s - --entitlements entitlements.xml --force ~/Library/Android/sdk/emulator/qemu/darwin-x86_64/qemu-system-x86_64

Answer based on https://www.arthurkoziel.com/qemu-on-macos-big-sur/

Related issues:

https://issuetracker.google.com/issues/181142249 https://issuetracker.google.com/issues/186436367

Update to Android Emulator 3.5.6 should fix it now

Original solution >>> Thanks to laalto

Change "hw.gpu.mode: auto" to "hw.gpu.mode = software".

I have faced this issue before, just follow step below;

  1. Go to SDK Manager -> SDK Tools
  2. Update 2 option below:
    • Android emulator
    • Intel x86 Emulator Accelerator (HAXM Installer)

enter image description here

Android Emulator's previous version seems to be not working with HAXM 7.6.5. If you install the new version of Android Emulator(30.5.6), It will work properly. If it still is not working, you should try cold boot. it worked for me.

it happened to me on windows 10 and the problem was in a file system called winspool.drv try to fix this file this what solved the problem for me open cmd in windows and run it as administrator and type this command sfc /scannow it will make a scan and will repair the corrupted file after the scan finished restart your computer and try to run the emulator again

You can use Android Emulator Apple Silicon Preview. I tried all other options and nothing works for me.

However this have some limitations currently. Probably will work better in the future.

Currently know issues are explained here as well. https://androidstudio.googleblog.com/2020/12/android-emulator-apple-silicon-preview.html

Here is one good article about this journey and full setup and faced issues with different solutions: https://medium.com/mobile-app-development-publication/my-journey-to-setup-android-emulator-for-m1-macbook-pro-b8365321b3e7

This has a very simple solution only if the installation process is complete and still the emulator is not launching, Solution: Just try to use older API version or any older stable android API version. In my case the latest version I was having was API-31, but the API-28 worked for me. Change your android API to any older version Try it. This worked for me.

Related