emulator: WARNING: Could not initialize OpenglES e

2019-01-22 11:58发布

问题:

What do these error messages mean from the Android emulator?

Starting emulator for AVD 'AVD'
Failed to create Context 0x3005
could not get wglGetExtensionsStringARB
emulator: WARNING: Could not initialize OpenglES emulation, using software renderer.
could not get wglGetExtensionsStringARB
could not get wglGetExtensionsStringARB
could not get wglGetExtensionsStringARB
could not get wglGetExtensionsStringARB
could not get wglGetExtensionsStringARB
could not get wglGetExtensionsStringARB
could not get wglGetExtensionsStringARB

回答1:

While starting the emulator from the command line - $ emulator64-arm -avd GalaxyS2 - I got a similiar (and maybe/hopefully) related message:

emulator: ERROR: Could not load OpenGLES emulation library: lib64OpenglRender.so: cannot open shared object file: No such file or directory

I found this file lib64OpenglRender.so through locate. It's in the tools/lib-subdirectory of the android-sdk-linux-dir.

So I created /etc/ld.so.conf.d/android_stuff.conf (you could of course add the following line to another *.conf-file in that directory) and put one line in:

path_to_android-sdk-linux_directory/tools/lib

Then call the configuration-tool: ldconfig (just without any parameter) and (at least in my case) the error-message went away.



回答2:

export LD_LIBRARY_PATH="/home/< user-pc>/Android/Sdk/tools/lib64:$LD_LIBRARY_PATH"

cd /home/nazmul/Android/Sdk/tools

./emulator64-x86 -avd < avd-name > -gpu on

This comand work on my laptop .



回答3:

Make sure you install the correct drivers for your graphics card. i was having the exact same error.



回答4:


I think Gerd's solution was the most helpful.

In case somebody stumbles across this, a more detailed and complete solution...

The vanilla studio.sh starter-shell script sets an env-variable:

LD_LIBRARY_PATH="$IDE_BIN_HOME:$LD_LIBRARY_PATH"

that it then exports. The IDE_BIN_HOME is set by using the location of the studio.sh file (somewhere in the middle - usually [android-studio]/bin). When an emulator is launched through Studio->Manger->Tools->Manage AVDs this env-var is prefixed with android-SDK/tools/bin. Meaning when you start it standalone, you didn't set that env-var. Gerd's solution adds the lib to the system lib-search-path. Another approach would be to create a wrapper that takes care of this so that it's only set when needed and (possibly) other things are also set.

#!/bin/bash
export JAVA_HOME="/usr/lib/jvm/java-BLAH"
export STUDIO_JDK="$JAVA_HOME"     #This is also used in studio.sh
export IDE_BIN_HOME="/home/you/android-studio/bin"
export Anroid_SDK="/home/you/android-sdk"
export LD_LIBRARY_PATH="$Anroid_SDK/tools/lib:$IDE_BIN_HOME:$LD_LIBRARY_PATH"

cd "$Anroid_SDK/tools"

./emulator64-x86 -avd AVD-NAME-1 -gpu on &
./emulator64-arm -avd AVD-NAME-2

This is probably a bit overdone, but it's complete ;) Depending on Distro/Setup JAVA_HOME may be preset, so you could drop that line. If you constantly use the emulator, you could also add something like

export LD_LIBRARY_PATH="[YOUR Studio PATH]/tools/lib:$LD_LIBRARY_PATH"

to your .bashrc or .profile file.

But to answer the actual question: It means that the emulator wasn't able to run (hardware-accel?) OpenGLES, and that it's using software routines to implement/emulate OpenGLES :D To enable emulator to find the desired lib, make sure you have proper (3D-Accel.?) graphic-card drivers installed, then choose one of the above (wrapper shell or (bash-)session-init settings).

Note that newer versions of Android-Studio have forked out the SDK



回答5:

It means the linker could not find OpenglES libraries on your system. You could try installing those.

On Fedora, this seems to solve the problem:

> yum install mesa-libGLw.i686

Some related information here: http://www.redips.net/android/emulator-fedora-linux/

Edit: For Windows-related things, this answer appears to do what you want.



回答6:

I too Had the same problem even if i have 512 MB of RAM. I solved by "Deleting" the older emulator and recreated the new emulator. Still i didn't know the reason for this issue.This issue is not yet closed by Google Developers . Hoping my solution help others.



回答7:

You have to play around with your android device specification like RAM, Heap other specification.

It's hard to tell you which must be set to what. In my case I set RAM as 512 and Heap 128 to make it work.



回答8:

One more tip...Check if you are not on virtual machine...I mean you should be on real machine.