Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Device Manager fails to launch after updating to MacOS Big Sur 11.3

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?

like image 884
centuryfall Avatar asked Apr 27 '21 17:04

centuryfall


People also ask

What to do if macOS Big Sur update failed?

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.

Why is my app not working on Big Sur 11 beta 6?

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.

Is it OK to install macOS 11 Big Sur?

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.

Does macOS Big Sur update affect macOS Catalina?

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.


Video Answer


3 Answers

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:

  • https://issuetracker.google.com/issues/181142249
  • https://issuetracker.google.com/issues/186436367
like image 102
laalto Avatar answered Oct 13 '22 23:10

laalto


Update your emulator to get rid of this issue.

Follow the steps below:

In your android studio go to SDK Manager -> SDK Tools Tab

  1. Select Android Emulator and update it

OR

  1. Uncheck Android Emulator and apply
  2. Check Android Emulator and apply

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

like image 45
Rishabh Saxena Avatar answered Oct 14 '22 01:10

Rishabh Saxena


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.

like image 43
UmutTekin Avatar answered Oct 14 '22 01:10

UmutTekin