【发布时间】:2020-05-07 17:55:48
【问题描述】:
我正在尝试使用 AVD 管理器运行 Android 模拟器。 这是我的avd: http://image-upload.de/image/fnx79V/52b0d050ee.png
这就是开始时发生的事情:
http://image-upload.de/image/vGpQfa/e912d83939.png
我有一台 Macbook Pro Retina。直接从英特尔页面安装 Haxm 驱动程序。
没有模拟器在工作。所有人都会收到相同的“错误”消息。
运行命令(当我使用 Homebrew 安装 Android-sdk 和 Android-platform-tools 时出现此错误 | 遇到相同问题的任何人都应该删除它或查看冲突所在)
export ANDROID_EMULATOR_DEBUG=1 test20
emulator:Found AVD name 'test20'
emulator:Found AVD target architecture: x86
emulator:Looking for emulator-x86 to emulate 'x86' CPU
emulator:Probing program: ./emulator-x86
emulator:Probing path for: emulator-x86
emulator:Found target-specific emulator binary: /usr/local/bin/emulator-x86
emulator:Probing for: /usr/local/bin/libOpenglRender.dylib
emulator:Probing for: /usr/local/bin/lib/libOpenglRender.dylib
emulator:Probing for: /usr/local/lib/libOpenglRender.dylib
emulator:Probing for: /usr/local/bin/lib64OpenglRender.dylib
emulator:Probing for: /usr/local/bin/lib/lib64OpenglRender.dylib
emulator:Probing for: /usr/local/lib/lib64OpenglRender.dylib
emulator:Could not find OpenGLES emulation host libraries!
emulator: ERROR: This AVD's configuration is missing a kernel file!!
emulator -avd test21
emulator:Found AVD name 'test21'
emulator:Found AVD target architecture: x86_64
emulator:Looking for emulator backend for x86_64 CPU
emulator:Probing program: ./emulator-x86_64
emulator:Probing path for: emulator-x86_64
emulator:Looking for emulator-x86 to emulate 'x86_64' CPU
emulator:Probing program: ./emulator-x86
emulator:Probing path for: emulator-x86
PANIC: Missing emulator engine program for 'x86_64' CPUS.
在我用 Homebrew 解决问题后:
我试了一下,发现了这个:
emulator64-x86 -avd test20
Creating filesystem with parameters:
Size: 69206016
Block size: 4096
Blocks per group: 32768
Inodes per group: 4224
Inode size: 256
Journal blocks: 1024
Label:
Blocks: 16896
Block groups: 1
Reserved block group size: 7
Created filesystem with 11/4224 inodes and 1302/16896 blocks
emulator: ERROR: Could not load OpenGLES emulation library: dlopen(lib64OpenglRender.dylib, 1): image not found
emulator: WARNING: Could not initialize OpenglES emulation, using software renderer.
HAX is working and emulator runs in fast virt mode
qemu: could not load PC BIOS 'bios.bin'
对于所有有同样问题的人,也许这些步骤会有所帮助:
在调试模式下运行你的模拟器:
export ANDROID_EMULATOR_DEBUG=1 emulatorName
如果路径看起来很奇怪,请检查 Homebrew 等其他安装并消除冲突(卸载一个)
当库丢失时,你需要导出变量:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ANDROID_HOME/tools/lib
当出现错误“qemu: could not load PC BIOS 'bios.bin'”时,一种解决方法是使用完整路径运行模拟器:
/Applications/Android\ Studio.app/sdk/tools/emulator64-x86 -avd test20
In your case it is maybe a other path.
【问题讨论】:
-
在我的情况下,出现此错误是因为 SDK 管理器没有安装 32 位二进制文件(emulator-arm 和 emulator-x86),但默认情况下模拟器程序仍在寻找它们。删除并重新安装 sdk 工具并没有为我添加 32 个二进制文件。我可以通过从终端运行 emulator64-arm -avd 'avdname' 来启动模拟器,但我仍然无法让 Android Studio 的 AVD 管理器意识到它需要查找 64 位二进制文件。 Eclipse 的 AVD 管理器似乎还不错
-
无论我是在
emulator还是tools中,PATH 修复都没有对我有用 - 我必须手动指定-kernel这篇文章的参数 stackoverflow.com/a/52161215/3700490 -
我刚刚留下了一个实际的解决方案,它解决了问题而不是解决它。
-
根据其中几个答案,为了节省辛苦的工作,我只是通过 SDK 管理器卸载并重新安装了 HAXM,问题就消失了。