可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
I am trying to run a Android Emulator by using AVD Manager.
this is my avd:
http://image-upload.de/image/fnx79V/52b0d050ee.png
and this is what happens by starting:
http://image-upload.de/image/vGpQfa/e912d83939.png
I have a Macbook Pro Retina. Installed the Haxm driver direct from intel page.
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)
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:
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)
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:
/Applications/Android\ Studio.app/sdk/tools/emulator64-x86 -avd test20
In your case it is maybe a other path.
回答1:
The following work-around to start emulator-x86 worked for me:
cd $SDK/tools;
ln -s emulator64-x86 emulator-x86
Or on Windows Win + X > Command Prompt (Admin)
cd %ANDROID_SDK_ROOT%\tools
mklink emulator64-x86.exe emulator-x86.exe
And now the emulator will start from the SDK manager.
Note: Emulators islocated in emulators
folder in more recent versions.
回答2:
If you are using macOS, add both Android SDK emulator
and tools
directories to the path:
Step 1: In my case the order was important, first emulator
and then tools
.
export ANDROID_SDK=$HOME/Library/Android/sdk
export PATH=$ANDROID_SDK/emulator:$ANDROID_SDK/tools:$PATH
Step 2: Reload you .bash_profile
Or .bashrc
depending on OS
Step 3: Get list of emulators available:
$emulator -list-avds
Step 4: Launch emulator from the command line and Replace avd
with the name of your emulator $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.
回答3:
Navigate to the emulator folder located within Android SDK folder
/ emulator
cd ${ANDROID_HOME}/emulator
Then type these command to open emulator without android studio:
---
$ ./emulator -list-avds
$ ./emulator -avd Nexus_5X_API_28_x86
[Nexus_5X_API_28_x86] is My AVD [you need to give your AVD name]
回答4:
I had this issue after upgrading Android Studio to 3.2 and even upgrade some SDK-Packages.
The cause was that the path to emulator had changed, so don't use ...../Android/Sdk/tools/emulator
but instead ....../Android/Sdk/emulator/emulator
.
回答5:
On Mac after installing Android Studio IDE android-studio-ide-173.4907809-mac.dmg
and using studio SDK Manager to install SDK Tools
Add to your PATH using ~/.profile
or ~/.bash_profile
and make sure you have $ANDROID_HOME/emulator
in your $PATH
before $ANDROID_HOME/tools
like so:
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'
回答6:
For 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
(btw, Nexus_S_API_27is a name of my custom emulator )).
Othewize it will abuse :
PANIC: Missing emulator engine program for 'x86' CPU.
).
回答7:
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
For short, run the emulator from the sdk/emulator
folder
回答8:
You cannot start emulator-x86 directory, because it needs to have LD_LIBRARY_PATH setup specially to find the PC Bios and GPU emulation libraries (that's why 'emulator' exists, it modifies the path, then calls emulator-x86).
Did you update the first ouput ? It looks like 'emulator' is still finding ' /usr/local/bin/emulator-x86'
回答9:
Try the following work-around to start emulator-x86:
export LD_LIBRARY_PATH=$SDK/tools/lib:$LD_LIBRARY_PATH
$SDK/tools/emulator-x86 <your-other-options>
Where $SDK is the path to your SDK installation. That's in a nutshell what 'emulator' tries to do. You might want to start emulator64-x86 instead of emulator-x86 if the former exists though.
回答10:
Had the same issue on Windows7 64bit. The reason why it didn't was missing emulator-x86.exe
file under sdk/tools. Fixed it by deleting Android SDK Tools using Android SDK Manager and installing it again. The file now exists and emulator works as expected.
回答11:
Avast Antivirus is sensing emulator-arm.exe as a thread and blocking from some reasons. When you add it exclusions in Virus Chest page with right-click -> "restore and add to exclusions" it's not solved in future runnings. To solve this permanently in Avast 2015 :
Settings ->
Active Protection ->
File System Shield ->
Customize ->
Exclusions then add thread as a exclusion . And then press ok.
回答12:
There are two named emulator
binary file. which located under $SDK/tools/emulator another under $SDK/emulator/
- please make sure u have the right emulator configure(need add $SDK/emulator to u env PATH
I have write a script to help me to invoke the avd list
#!/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 [ "$1" = "23" ]
then
echo "enter 23"
cd $HOME_EMULATOR
./emulator -avd Nexus_5_API_23_Android6_ &
cd $HOME_CURRENT
fi
if [ "$1" = "28" ]
then
echo "enter 28"
cd $HOME_EMULATOR
./emulator -avd Nexus_5_API_28_GooglePlay_ &
cd $HOME_CURRENT
fi
回答13:
Delete both Android SDK Tools and Android SDK PLatform-tools; then download both packages again. Now, create a new emulator and start it; it will work. You might be able to run your old emulators.
回答14:
This message means the 'emulator-x86' or 'emulator64-x86' program is missing from $SDK/tools/, or cannot be found for some reason.
First of all, are you sure you have a valid download / install of the SDK?
回答15:
see if your .exe file is in your antivirus quarantine
Solution :
1- Download the adt-bundle again from https://developer.android.com/tools/sdk.
2- Open the Zip File.
3- Copy the missing .exe Files From the Folder "\sdk\tools".
4- Past the Copied Files in Your "Android\sdk\tools" Directory.
回答16:
This worked for me on macOS:
echo 'export PATH=$PATH:'$HOME'/Library/Android/sdk/emulator:'$HOME'/Library/Android/sdk/tools:'$HOME'/Library/Android/sdk/platform-tools' >> ~/.bash_profile
source ~/.bash_profile
回答17:
ON WINDOWS - updating the system path worked for me. Create an environment variable for the location of your sdk called ANDROID_SDK then add these to your path, in this order:
%ANDROID_SDK%\emulator
%ANDROID_SDK%\platform-tools
%ANDROID_SDK%\tools
%ANDROID_SDK%\tools\bin