更新 Big Sur 11.3 后,Android 模拟器不工作或不显示 [英] Android Emulator not working or showing after update Big Sur 11.3

查看:44
本文介绍了更新 Big Sur 11.3 后,Android 模拟器不工作或不显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我今天将 mac os big sur 11.2 更新到 11.3.

Hi I updated the mac os big sur 11.2 to 11.3 today.

I am using Android Studio 4.1.3
Build #AI-201.8743.12.41.7199119, built on March 10, 2021
Runtime version: 1.8.0_242-release-1644-b3-6915495 x86_64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
macOS 10.16
GC: ParNew, ConcurrentMarkSweep
Memory: 1979M
Cores: 16

Android Emulator 未打开,但它在 avd 管理器的 Dock 中打开.我试过来自 Stack Overflow 的重大更新.但它对我不起作用,我按照给定的命令使用了

Android Emulator not opening, but it opens in docks from avd manager. I tried Big sur update from Stack Overflow. But it didn't work for me I used command as per given

~/Library/Android/sdk/emulator/emulator -gpu host -feature HVF -avd 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/vmodi/Library/Android/sdk/emulator/qemu/darwin-x86_64/lib64/vulkan/libvulkan.dylib: failed
added library /Users/vmodi/Library/Android/sdk/emulator/lib64/vulkan/libvulkan.dylib
cannot add library /Users/vmodi/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/vmodi/Library/Android/sdk/emulator/lib64/vulkan/libMoltenVK.dylib

任何人都知道如何解决这个问题.

Anyone know how to solve this problem.

推荐答案

基于 这篇文章 这似乎是在 OSX 11.3 中更新的一些 hypervisor 权利的问题.

Based on this post this appears to be an issue with some hypervisor entitlements that got updated in OSX 11.3.

在模拟器应用程序中提供官方修复之前,可以通过创建具有以下内容的 entitlements.xml 文件来修复

Till an official fix is provided in the emulator app, it can be fixed by creating an entitlements.xml file 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>

然后运行

codesign -s - --entitlements entitlements.xml --force ~/Library/Android/sdk/emulator/qemu/darwin-x86_64/qemu-system-x86_64

(qemu 的路径可能需要根据 Android SDK 的安装路径进行调整)

(the path to qemu might need to be adjusted depending on Android SDK's installation path)

这个解决方案也被其他类似帖子提出,为了方便起见,我在这里重复了一遍.

This solution was also suggested on other similar posts, I repeated it here for convenience.

这篇关于更新 Big Sur 11.3 后,Android 模拟器不工作或不显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆