Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Emulator can not start after update to macOS Big Sur 11.3 today

I updated today the macOS to Big Sur 11.3, the android emulator can not work any more:

My Computer: Macbook Pro 2019

Android Studio Version: 4.1.3

Android Simulator Version: 30.5.5

Message: The emulator process for AVD xxx was killed.

I tried reinstall the android studio and restart, but the error is still the same. I can not start the android Emulator... :(

Error is here, It somehow related to GLDirectMem/Vulkan:

enter image description here

enter image description here

Do you have idea, how to fix it?

like image 721
xirururu Avatar asked Jan 26 '26 23:01

xirururu


2 Answers

This error occurs because Apple has made changes to the hypervisor entitlements. What you want to do is:

  1. Use /Users/<username>/Library/Android/sdk/emulator/qemu/darwin-x86_64/qemu-system-x86_64 as the directory for qemu

  2. Add the entitlement to the qemu-system-x86_64 binary by:

    • First create an xml file named entitlements.xml (does not matter where) with this 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>
    
    • Then sign the qemu binary with it:
    codesign -s - --entitlements entitlements.xml --force /Users/<username>/Library/Android/sdk/emulator/qemu/darwin-x86_64/qemu-system-x86_64
    

For more context, refer here

like image 197
Mayokun Avatar answered Jan 28 '26 14:01

Mayokun


Check 1:

If you have a Docker installed, stop that. It interrupt the emulator.

Check 2:

Try to launch your emulator from the command line, type:

  1. cd $ANDROID_SDK_ROOT
  2. tools/emulator -list-avds
  3. tools/emulator @name_of_avd -verbose

The ANDROID_SDK_ROOT environment value should point to the android SDK location. You can find this in android studio under the menu tools -> sdk manager.

Check 3:

  1. Delete all AVD's that you currently have.
  2. Go to Preferences >> Android SDK >> SDK Tools
  3. Uninstall Android Emulator
  4. Restart Android Studio
  5. Re-install Android Emulator from the same place.
  6. And finally create a new emulator

Sidenote:

I made a documentation for AMD processors facing emulator issue on Windows systems. Probably something from there could help also. Give it a shot and let me know if it worked. Cheers!

PS: Make sure you installed the latest Vulkan driver for MacOS (Intel CPU) Download the driver from my other Intel documentation or try this usefull post I found.

like image 30
Etienne Kaiser Avatar answered Jan 28 '26 13:01

Etienne Kaiser