android-emulatormacos-big-surandroid-studio-4.1

Android Emulator 30.4.5 not working on MacOS


System Info

MacOs Version - 11.3 Beta

Android Studio Version - 4.1.2

Android Emulator Version - 30.4.5

Android HAXM Version - 7.5.1

Error Stack

emulator: Android emulator version 30.4.5.0 (build_id 7140946) (CL:N/A)
handleCpuAcceleration: feature check for hvf
cannot add library /Users/rajaparikshit/Library/Android/sdk/emulator/qemu/darwin-x86_64/lib64/vulkan/libvulkan.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/rajaparikshit/Library/Android/sdk/emulator/lib64/vulkan/libvulkan.dylib
cannot add library /Users/rajaparikshit/Library/Android/sdk/emulator/qemu/darwin-x86_64/lib64/vulkan/libMoltenVK.dylib: failed
added library /Users/rajaparikshit/Library/Android/sdk/emulator/lib64/vulkan/libMoltenVK.dylib

Android emulator version - 30.0.26 was running perfectly as expected. But after 30.4.5.0 update its not working.

I tried to search way to downgrade to 30.0.26 but I couldn't find one i.e. there is no any option in android studio manager also.

I saw this SO post. Google store all the emulators version in repository URL - http://dl.google.com/android/repository/ but I didn't know the build version for 30.0.26 version so couldn't go this way.

Update -

Please follow the accepted answer below and do give upvote.

For newbies or if you get stuck at any point please follow the steps:

  1. If you have uninstalled the latest version of emulator as its not working, then please install it again. (Because if we manually replace the emulator directory Android Studio is not able to recognise it and hence you won't able to create/run AVD from Android Studio)

  2. Download the zip file from the URL mentioned in answer.

  3. Copy(Not Move) the content to your original emulator directory.

  4. Restart the android studio if needed.

Still this is just a workaround, actual issue with this new version is still there.


Solution

  • Here is the link for the emulator revision 30.0.26 https://dl.google.com/android/repository/emulator-darwin-6885378.zip (taken from this answer)

    Download it and then copy over the installed emulator.

    It won't work if you have files quarantine enabled; I did so I needed to remove quarantine recursively from downloaded files

    xattr -r -d com.apple.quarantine /path/to/dir
    

    Then I can run the emulator by invoking:

    emulator @device_name
    

    It doesn't seem to be detected by AS, but works nonetheless.