Android 模拟器错误消息:“恐慌:缺少‘x86’CPUS 的模拟器引擎程序。”

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/26483370/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-20 11:34:41  来源:igfitidea点击:

Android Emulator Error Message: "PANIC: Missing emulator engine program for 'x86' CPUS."

androidandroid-emulator

提问by Visores

I am trying to run a Android Emulator by using AVD Manager. this is my avd: http://image-upload.de/image/fnx79V/52b0d050ee.png

我正在尝试使用 AVD 管理器运行 Android 模拟器。这是我的 avd:http://image-upload.de/image/fnx79V/52b0d050ee.png

and this is what happens by starting:

这是通过开始发生的事情:

http://image-upload.de/image/vGpQfa/e912d83939.png

http://image-upload.de/image/vGpQfa/e912d83939.png

I have a Macbook Pro Retina. Installed the Haxm driver direct from intel page.

我有一台 Macbook Pro Retina。直接从英特尔页面安装 Haxm 驱动程序。

No emulator is working. All get the same "error" message.

没有模拟器在工作。所有人都收到相同的“错误”消息。

Running Command (This error was when i used Homebrew for installing Android-sdk and Android-platform-tools | anyone who get the same problem should remove this or look where the conflict is)

运行命令(当我使用 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.

After I fixed the problem with Homebrew:

在我用 Homebrew 解决了这个问题之后:

I tried a bit around and found this:

我尝试了一下,发现了这个:

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'

For all who has the same problem, maybe these steps help:

对于所有遇到相同问题的人,也许这些步骤会有所帮助:

Run your Emulator in Debug mode:

在调试模式下运行你的模拟器:

export ANDROID_EMULATOR_DEBUG=1 emulatorName

If there is a path that look strange check for other installations like Homebrew and remove the conflict (uninstall one)

如果有一个看起来很奇怪的路径,请检查 Homebrew 等其他安装并消除冲突(卸载一个)

When the library is missing you need to export the variable:

当库丢失时,您需要导出变量:

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ANDROID_HOME/tools/lib

And when error "qemu: could not load PC BIOS 'bios.bin'" appears, one fix is to run the emulator with the full path:

当出现错误“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.

回答by enreas

If you are using macOS, add both Android SDK emulatorand toolsdirectories to the path:

如果您使用的是 macOS,请将 Android SDKemulatortools目录添加到路径中:

Step 1:In my case the order was important, first emulatorand then tools.

第1步:在我的情况的顺序是非常重要的,第一emulator,然后tools

export ANDROID_SDK=$HOME/Library/Android/sdk
export PATH=$ANDROID_SDK/emulator:$ANDROID_SDK/tools:$PATH

Step 2:Reload you .bash_profileOr .bashrcdepending on OS

第 2 步:重新加载.bash_profile.bashrc取决于操作系统

Step 3:Get list of emulators available: $emulator -list-avds

第 3 步:获取可用的模拟器列表: $emulator -list-avds

Step 4:Launch emulator from the command line and Replace avdwith the name of your emulator $emulator @avd

第 4 步:从命令行启动模拟器并替换avd为您的模拟器名称$emulator @avd

Don't forget to add the @symbol.

不要忘记添加@符号。

This was tested with macOS High Sierra 10.13.4 and Android Studio 3.1.2.

这是使用 macOS High Sierra 10.13.4 和 Android Studio 3.1.2 测试的。

回答by suther

I had this issue after upgrading Android Studio to 3.2 and even upgrade some SDK-Packages.

将 Android Studio 升级到 3.2 甚至升级了一些 SDK 包后,我遇到了这个问题。

The cause was that the path to emulator had changed, so don't use ...../Android/Sdk/tools/emulatorbut instead ....../Android/Sdk/emulator/emulator.

原因是模拟器的路径发生了变化,所以不要使用...../Android/Sdk/tools/emulatorbut 代替....../Android/Sdk/emulator/emulator.

回答by Tongfa

The following work-around to start emulator-x86 worked for me:

以下启动 emulator-x86 的解决方法对我有用:

cd $SDK/tools; 
ln -s emulator64-x86 emulator-x86

Or on Windows open Command Prompt (Admin)

或者在 Windows 上打开命令提示符(管理员)

cd %ANDROID_SDK_ROOT%\tools
mklink emulator64-x86.exe emulator-x86.exe

And now the emulator will start from the SDK manager.

现在模拟器将从 SDK 管理器启动。

Note: Emulators islocated in emulatorsfolder in more recent versions.

注意:模拟器位于emulators较新版本的文件夹中。

回答by abinthomas12914

Navigate to the emulator folder located within Android SDK folder/ emulator

导航到位于Android SDK folder/ 中的模拟器文件夹emulator

cd ${ANDROID_HOME}/emulator

cd ${ANDROID_HOME}/emulator

Then type these command to open emulator without android studio:

然后键入这些命令以在没有 android studio 的情况下打开模拟器:

$ ./emulator -list-avds
$ ./emulator -avd Nexus_5X_API_28_x86

Nexus_5X_API_28_x86is My AVD you need to give your AVD name

Nexus_5X_API_28_x86是我的 AVD,您需要提供您的 AVD 名称

回答by CodeToLife

For Windows 10, 5.29.18 :

对于 Windows 10,5.29.18:

Using command promt I just got in the emulator directory:

使用命令提示符我刚进入模拟器目录:

cd C:\Android\sdk\emulator

and then typed the command:

然后输入命令:

emulator -avd Nexus_S_API_27

Nexus_S_API_27is the name of my custom emulator.

Nexus_S_API_27是我的自定义模拟器的名称。

Othewize it will abuse :

否则它会滥用:

PANIC: Missing emulator engine program for 'x86' CPU.

回答by ilovett

On Mac after installing Android Studio IDE android-studio-ide-173.4907809-mac.dmgand using studio SDK Manager to install SDK Tools

在 Mac 上安装 Android Studio IDEandroid-studio-ide-173.4907809-mac.dmg并使用 studio SDK Manager 安装 SDK Tools

enter image description here

在此处输入图片说明

Add to your PATH using ~/.profileor ~/.bash_profileand make sure you have $ANDROID_HOME/emulatorin your $PATHbefore $ANDROID_HOME/toolslike so:

使用~/.profile或添加到您的 PATH~/.bash_profile并确保$ANDROID_HOME/emulator$PATH之前$ANDROID_HOME/tools像这样:

export ANDROID_HOME=$HOME/Library/Android/sdk
export PATH=$PATH:$ANDROID_HOME/emulator
export PATH=$PATH:$ANDROID_HOME/tools
export PATH=$PATH:$ANDROID_HOME/tools/bin
export PATH=$PATH:$ANDROID_HOME/platform-tools

alias androidemulator='emulator -avd Nexus_5X_API_28_x86'

回答by caopeng

There are two named emulatorbinary file. which located under $SDK/tools/emulatoranother under $SDK/emulator/

有两个命名的emulator二进制文件。其中位于$SDK/tools/emulator另一个下$SDK/emulator/

  • please make sure you have the right emulator configure(need add $SDK/emulatorto your env PATH
  • 请确保您有正确的模拟器配置(需要添加$SDK/emulator到您的环境路径

I have write a script to help me to invoke the avd list

我写了一个脚本来帮助我调用 avd 列表

    #!/bin/bash -e


    echo "--- $# $(PWD)"
    HOME_CURRENT=$(PWD)
    HOME_EMULATOR=/Users/pcao/Library/Android/sdk/emulator

    if [ "$#" -eq 0 ]
    then
        echo "ERROR pls try avd 23 or avd 28 " 
    fi

    if [ "" = "23" ]
    then
        echo "enter 23"
        cd $HOME_EMULATOR
        ./emulator -avd Nexus_5_API_23_Android6_ &
        cd $HOME_CURRENT
    fi

    if [ "" = "28" ]
    then
        echo "enter 28"
        cd $HOME_EMULATOR
        ./emulator -avd Nexus_5_API_28_GooglePlay_ &
        cd $HOME_CURRENT
    fi


回答by Christopher Jordan

ON WINDOWS - updating the system path worked for me. Create an environment variable for the location of your sdk called ANDROID_SDKthen add these to your path, in this order:

在 WINDOWS 上 - 更新系统路径对我有用。为您的 sdk 位置创建一个环境变量,ANDROID_SDK然后按以下顺序将它们添加到您的路径中:

%ANDROID_SDK%\emulator
%ANDROID_SDK%\platform-tools
%ANDROID_SDK%\tools
%ANDROID_SDK%\tools\bin

回答by Francis Bacon

Tested on macOS Mojave 10.14.5.

在 macOS Mojave 10.14.5 上测试。

Reason and Solution:

原因及解决方法:

we use sdk/tools/emulator, we should use sdk/emulator.

我们使用sdk/tools/emulator,我们应该使用sdk/emulator

WM-C02WM0T3HTD8:~ zgong$ emulator -avd Pixel_3_XL_API_Q_x86
PANIC: Unknown AVD name [Pixel_3_XL_API_Q_x86], use -list-avds to see valid list.
HOME is defined but there is no file Pixel_3_XL_API_Q_x86.ini in $HOME/.android/avd
(Note: Directories are searched in the order $ANDROID_AVD_HOME, $ANDROID_SDK_HOME/avd, and $HOME/.android/avd)
WM-C02WM0T3HTD8:~ zgong$ emulator -avd Pixel_3_XL_API_Q
PANIC: Missing emulator engine program for 'x86' CPU.

We could check the emulator location:

我们可以检查模拟器位置:

WM-C02WM0T3HTD8:~ zgong$ which emulator
/Users/zgong/Library/Android/sdk/tools/emulator

I did a bunch of googling and while most of the answers were about setting the paths correctly in terminal, it turns out it was actually to do with a shift in a recent version of the SDK, where the emulator app is located in /emulator instead of /tools. Leaving this here in case anyway runs into the same problem.

我做了一堆谷歌搜索,虽然大多数答案都是关于在终端中正确设置路径,但事实证明它实际上与最新版本的 SDK 的转变有关,其中模拟器应用程序位于 /emulator 中/工具。留在这里以防万一遇到同样的问题。

We need to use as below:

我们需要使用如下:

{sdk location}/emulator -avd {avd name}

{sdk location}/emulator -avd {avd name}

Here is the real output:

这是真正的输出:

WM-C02WM0T3HTD8:~ zgong$ /Users/zgong/Library/Android/sdk/emulator/emulator -avd Pixel_3_XL_API_Q
pc_memory_init: above 4g size: 40000000
emulator: WARNING: UpdateCheck: Failure: Error
emulator: WARNING: UpdateCheck: failed to get the latest version, skipping check (current version '29.2.1-5889189')
emulator: WARNING: UpdateCheck: Failure: Error
WebSocketServer listening on port 55850
Qt WebEngine ICU data not found at /Users/joshuaduong/qt-build-5.12.1/install-darwin-x86_64/resources. Trying parent directory...
Qt WebEngine ICU data not found at /Users/joshuaduong/qt-build-5.12.1/install-darwin-x86_64/resources. Trying parent directory...
Qt WebEngine ICU data not found at /Users/joshuaduong/qt-build-5.12.1/install-darwin-x86_64. Trying application directory...
Qt WebEngine ICU data not found at /Users/joshuaduong/qt-build-5.12.1/install-darwin-x86_64. Trying application directory...
Installed Qt WebEngine locales directory not found at location /Users/joshuaduong/qt-build-5.12.1/install-darwin-x86_64/translations/qtwebengine_locales. Trying application directory...
Qt WebEngine locales directory not found at location /Users/zgong/Library/Android/sdk/emulator/lib64/qt/libexec/qtwebengine_locales. Trying fallback directory... Translations MAY NOT not be correct.
Installed Qt WebEngine locales directory not found at location /Users/joshuaduong/qt-build-5.12.1/install-darwin-x86_64/translations/qtwebengine_locales. Trying application directory...
Qt WebEngine locales directory not found at location /Users/zgong/Library/Android/sdk/emulator/lib64/qt/libexec/qtwebengine_locales. Trying fallback directory... Translations MAY NOT not be correct.
Path override failed for key ui::DIR_LOCALES and path '/Users/zgong/.QtWebEngineProcess'
Path override failed for key ui::DIR_LOCALES and path '/Users/zgong/.QtWebEngineProcess'
Qt WebEngine resources not found at /Users/joshuaduong/qt-build-5.12.1/install-darwin-x86_64/resources. Trying parent directory...
Qt WebEngine resources not found at /Users/joshuaduong/qt-build-5.12.1/install-darwin-x86_64. Trying application directory...
Qt WebEngine resources not found at /Users/joshuaduong/qt-build-5.12.1/install-darwin-x86_64/resources. Trying parent directory...
Qt WebEngine resources not found at /Users/joshuaduong/qt-build-5.12.1/install-darwin-x86_64. Trying application directory...
[0403/154905.171893:WARNING:resource_bundle_qt.cpp(116)] locale_file_path.empty() for locale
[0403/154905.171871:WARNING:resource_bundle_qt.cpp(116)] locale_file_path.empty() for locale
Qt WebEngine ICU data not found at /Users/joshuaduong/qt-build-5.12.1/install-darwin-x86_64/resources. Trying parent directory...
Qt WebEngine ICU data not found at /Users/joshuaduong/qt-build-5.12.1/install-darwin-x86_64. Trying application directory...
Installed Qt WebEngine locales directory not found at location /Users/joshuaduong/qt-build-5.12.1/install-darwin-x86_64/translations/qtwebengine_locales. Trying application directory...
Qt WebEngine locales directory not found at location /Users/zgong/Library/Android/sdk/emulator/lib64/qt/libexec/qtwebengine_locales. Trying fallback directory... Translations MAY NOT not be correct.
Path override failed for key ui::DIR_LOCALES and path '/Users/zgong/.QtWebEngineProcess'
Qt WebEngine resources not found at /Users/joshuaduong/qt-build-5.12.1/install-darwin-x86_64/resources. Trying parent directory...
Qt WebEngine resources not found at /Users/joshuaduong/qt-build-5.12.1/install-darwin-x86_64. Trying application directory...
[0403/154907.393116:WARNING:resource_bundle_qt.cpp(116)] locale_file_path.empty() for locale

Reference: https://www.reddit.com/r/androiddev/comments/a978kx/mac_can_run_emulator_fine_through_android_studio/

参考:https: //www.reddit.com/r/androiddev/comments/a978kx/mac_can_run_emulator_fine_through_android_studio/

回答by Bakhshi

You can also try what is suggested here: https://www.stkent.com/2017/08/10/update-your-path-for-the-new-android-emulator-location.html

您也可以尝试这里的建议:https: //www.stkent.com/2017/08/10/update-your-path-for-the-new-android-emulator-location.html

For short, run the emulator from the sdk/emulatorfolder

简而言之,从sdk/emulator文件夹运行模拟器