So my Mac just forced updated to Big Sur 11.3. I've been trying to access the Android Device Manager to run an emulated device and it has been silently failing each time. When I tried to run it from the command line, I get this error message:
emulator @Pixel_3a_API_30
emulator: Android emulator version 30.5.5.0 (build_id 7285888) (CL:N/A)
handleCpuAcceleration: feature check for hvf
cannot add library /Users/centuryfall/Library/Android/sdk/emulator/qemu/darwin-x86_64/lib64/vulkan/libvulkan.dylib: failed
added library /Users/centuryfall/Library/Android/sdk/emulator/lib64/vulkan/libvulkan.dylib
cannot add library /Users/centuryfall/Library/Android/sdk/emulator/qemu/darwin-x86_64/lib64/vulkan/libMoltenVK.dylib: failed
HVF error: HV_ERROR
qemu-system-x86_64: failed to initialize HVF: Invalid argument
Failed to open the hax module
No accelerator found.
qemu-system-x86_64: failed to initialize HAX: Operation not supported by device
added library /Users/centuryfall/Library/Android/sdk/emulator/lib64/vulkan/libMoltenVK.dylib
(Replaced actual username with "centuryfall").
I've looked at some other questions that say that the AVD needs to be version 30. I have AVD v30.5.5.0 Has anyone else had this issue?
Some users get stuck on macOS Big Sur update or macOS Big Sur installation failed. If the macOS Big Sur update frozen on your Mac, do as follows: Turn off your Mac and restart it after a couple more seconds. Boot your Mac into safe mode and install the macOS again.
macOS Big Sur 11 beta 6 is required to use the restore images for iOS & iPadOS 14 or later. Delete the app not working and reinstall them. Update the app. If you recently installed a new version of macOS, some apps may need to be updated to work correctly. Contact the app's manufacturer.
While most people have sorted through those initial problems, it’s ok if you haven’t. macOS 11 Big Sur was the biggest leap forward Apple’s OS has taken in a long time, setting it apart from previous iterations.
This does not happen with macOS Catalina but happens with Big Sur when using Xcode 12 with the new SwiftUI App lifecycle or Xcode 11 with the old UIKit life cycle." Bonus Tip: Lost Data after MacOS Big Sur Update, How to Recover? You will loss important data if the MacOS Big Sur update is interrupted.
Update 2021-04-29: Emulator version 30.5.6 now in stable channel and it fixes this issue. Old answer preserved below.
Apple has changed hypervisor entitlements (permissions), deprecating com.apple.vm.hypervisor
with com.apple.security.hypervisor
. Before Google fixes emulator code signing with the new entitlements you can work around the issue by granting the entitlement yourself.
Create a file entitlements.xml
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>
and run
codesign -s - --entitlements entitlements.xml --force /usr/local/bin/qemu-system-x86_64
Replace qemu path as necessary where your SDK is located. Could be e.g. ~/Library/Android/sdk/emulator/qemu/darwin-x86_64/qemu-system-x86_64
on some SDK installations.
Answer based on https://www.arthurkoziel.com/qemu-on-macos-big-sur/
Related issues:
Update your emulator to get rid of this issue.
Follow the steps below:
In your android studio go to SDK Manager -> SDK Tools Tab
OR
If you want to stay with the Android Emulator version below 30.5.6 you can follow the steps mentioned in the accepted answer here
If you get entitlements.xml: cannot read entitlement data
error you should start the terminal at folder which include qemu-system-x86_64 file.
For example my qemu-system-x86_64
file is in this location : /Users/yourusername/Library/Android/sdk/emulator/qemu/darwin-x86_64/qemu-system-x86_64
Now right click on darwin-x86_64
folder and click New terminal Tab at Folder
. Don't forget the copy your entitlements.xml
file into the darwin-x86_64
folder. Now in this terminal run the command which @laalto said. If you have any question, i'll gladly answer.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With