ZDev1
ZDev1

Reputation: 51

Android Studio raises this error: 'The emulator process for AVD was killed.'

I am trying to learn Android Development in Android Studio. I installed the requirements:

image

but nothing works, it just raises an error, and the error says, 'The emulator process for AVD was killed.'

Upvotes: 2

Views: 326

Answers (1)

DevGuy
DevGuy

Reputation: 635

With the new macOS Big Sur 11.3 update, the emulator in Android Studio no longer runs. This error occurs because Apple has made changes to the hypervisor entitlements.

Steps to fix the issue:

  1. Open Terminal and go to the directory
cd <ANDROID_SDK_ROOT>/emulator/qemu/darwin-x86_64

In my case
cd ~/Library/Android/sdk/emulator/qemu/darwin-x86_64/qemu-system-x86_64

  1. Create an xml file named entitlements.xml with touch or cat commands.
touch entitlements.xml
  1. Add this content to the entitlements.xml file:
<?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. Then simply sign the qemu-system-x86_64 with it:
codesign -s - --entitlements entitlements.xml --force qemu-system-x86_64

Now simply restart Android Studio and the Android Emulator should work again!

Upvotes: 2

Related Questions