emulator: WARNING: Could not initialize OpenglES emulation, using software renderer - android

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

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.

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 .

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

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

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.

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.

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.

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

Related

black screen in Android emulator in Ubuntu VM in Windows 7

I built AOSP 5.1.0_r5 (LMY47O) with no modifications done to the source code. The build process ends with "success" and I get bunch of *.img files in out/target/product/deb. Sadly, executing emulator -verbose produces the generic emulator window with an empty screen and following output in the console. I see nothing that would explain the black screen. (I am looking at the black screen for tens of minutes, hence I doubt it is "merely very slow.")
My environment is Ubuntu 16.04 running in VirtualBox under Windows 7, no IDE involved.
Just an assumption. You have a line in your output: Failed to create Context 0x3005
Could not initialize emulated framebufferemulator: Can't start OpenGLES renderer? It seems that this is the cause of the problem. Could you please install the following libraries sudo apt-get install mesa-utils-extra and run your emualator once again?
P.S. What is the target deb? Try to build the AOSP using a recommended target, e.g., aosp_arm-eng.

Android AVD set custom hardware

I am trying to decrease the ridiculous CPU usage of my Android emulator.
Thanks to this answer I found out that the CPU usage can be greatly decreased by disabling audio.
Solutions
I found out there are three ways to run the emulator without audio.
As a command line flag:
$ emulator -avd <name> -noaudio
By editing ~/.android/<name>.avd/config.ini and replacing this line:
hw.audioInput=yes
with these two:
hw.audioInput=no
hw.audioOutput=no
Instead of using the graphical AVD manager, use the following command to create an emulator:
$ android create avd -n <name> -t <target>
Cons
All of these methods have downsides though.
Requires to pass the -noaudio flag each time. This means it can't be run from AVD manager.
config.ini is reset each time an edit is made using AVD manager.
Requires to explicitly set every property of the device instead of just being able to use a preset configuration.
Attempted (failed) solution
I decided it might help to just clone an existing device and disable the audio there.
However¸ this just created ~/.android/devices.xml and I couldn't fine any reference how to disable audio by default nor any ini files containing hardware definitions.
Question
Is it possible to create a predefined hardware configuration that has sound disabled by default? If so, how?

"ERROR: OpenGLES initialization failed!" on CentOS with android SKD

When I run:
/usr/local/android-sdk-linux/tools/emulator -avd tst
I get the error:
Failed to open lib64EGL_translator
Failed to init_egl_dispatch
emulator: ERROR: OpenGLES initialization failed!
emulator: ERROR: OpenGLES emulation library could not be initialized!
emulator: WARNING: Could not initialize OpenglES emulation, using software renderer.
emulator: emulator window was out of view and was recentered
I've followed the steps here: http://www.redips.net/android/emulator-fedora-linux/
I've also tried using the commands emulator-arm and emulator64-arm
Another thing I tried was
export LD_LIBRARY_PATH=/usr/local/android-sdk-linux/tools/lib:$LD_LIBRARY_PATH
Another attempt was with the parameters:
-no-audio -gpu off
I'm using a fresh install of CentOS 6.6 with yum update ran. I'm using the android SDK: http://dl.google.com/android/android-sdk_r23.0.2-linux.tgz
I ran /usr/local/android-sdk-linux/tools/android and installed the Android 5.0 api+arm. I tried again with a Android 4.4 AVM.
I've tried all the suggestions I could find. Any other suggestions?
Before running the emulator from the command line add the lib64 directory to the LD_LIBRARY_PATH, e.g.:
$ export LD_LIBRARY_PATH=/usr/local/android-sdk-linux/tools/lib64:$LD_LIBRARY_PATH
or
$ export LD_LIBRARY_PATH=$HOME/Android/Sdk/tools/lib64:$LD_LIBRARY_PATH
dependently on the SDK installation path.
My reply is meant to "second" brian's post, so it is known brian is not the only one seeing this error.
On my CentOS 6.6 box I have also tried the same steps listed and I am also seeing nearly the same error messages. The only difference is I do not get:
emulator: emulator window was out of view and was recentered
My emulator does run with just basic invocation (this AVD is not configured to use the host's GPU):
emulator -avd Nexus_S_ARM
But the error messages indicate something is broken and should be put right.
The 'export LD_LIBRARY_PATH=/usr/local/android-sdk-linux/tools/lib:$LD_LIBRARY_PATH' made it workd for me. Also specfied '-gpu off' in the command line.

how to run the emulator from the command line on ubuntu11.10

I am new to android building, so please excuse me if my question is
too easy :)
My build process seemed to be successful, however the "emulator" command fails with
this error:
emulator: ERROR: bad workspace: cannot find prebuilt kernel in: /aosp/
prebuilt/android-arm/kernel/kernel-qemu-armv7 .
I have no idea why I am getting this error.
please help me.
//here andy_1.6 is my avd name.
padmakumar#padmakumar-desktop:~$ emulator -avd andy_1.6
//creating avd using cmd
padmakumar#padmakumar-desktop:~$ android create avd -n testavd
how to create avd
Old post but the problem is that cyanogenmod changed some stuff (including the location of prebuilt kernel), and when you do a source build/envsetup.sh this should fix it but it doesn't, anyway here's how you fix it:
emulator -kernel prebuilt/android-arm/kernel/kernel-qemu-armv7
In 4.3, the path has changed, try this:
emulator -kernel /Volumes/android/prebuilts/qemu-kernel/arm/kernel-qemu-armv7
In the future, if you would like to get an insight in terms of how does the emulator pick the default kernel, try:
emulator -verbose
then look for kernel.path to find out.

Not able to launch android emulator

When I run my hello world application, the android emulator fails to launch.Even when i am creating a new emulator it fails to launch giving me the following error.
[2011-08-09 17:03:10 - Emulator] invalid command-line parameter: Files\Android\android-sdk\tools/emulator-arm.exe.
[2011-08-09 17:03:10 - Emulator] Hint: use '#foo' to launch a virtual device named 'foo'.
[2011-08-09 17:03:10 - Emulator] please use -help for more information
First of all you need to check are you in correct folder?
$...local\Android\sdk\tools\emulator -list-avds
If so it will show you list of emulators that you have in your Android studio you are on right track
Last part for launching an emulator
local\Android\sdk\tools\emulator -avd Nexus_5X(name of your emulator you want to open)
The problem is, that you have specified your SDK in a file what has space, in its name For example: Android SDK You need to change it to something what hasn't got space in its name.
Hope it helps.
Or if you specified it in the Program Files use it:
Progra~1 instead of Program Files.
You are not specifying what AVD to launch. Please read the SDK docs in full, they will show you how to do this.
Tip: Launch the "android.exe" (I think, I use Linux where it's simply "android") app instead, create an AVD and launch it, all from the graphical interface.
The tricky part is finding name #foo
to find exact name of emulator run android command line emulator -list-avds aka ~/Library/Android/sdk/tools/emulator -list-avds
2.it will show you emulator names but emulator names that you pass to command line
bonus: you probably will get PANIC error in that case you need to add ANDROID_PATH read more here https://stackoverflow.com/a/49511666/6133329
On windows don't install the Android SDK to a path with spaces in it like C:\Program Files\AndroidSDK. Instead install it to C:\AndroidSDK\ or something like that.
Try this It worked for me...
emulator #avd_name [ {-option [value]} … ]
Type command emulator #youremulatorname
For more Check out this Link
For Windows
Check whether you have an emulator on your PC.
If it is there add the path below to the environment variable
C:\Users%username%\AppData\Local\Android\Sdk\emulator
and
remove C:\Users\deepank\AppData\Local\Android\Sdk\tools
:

Categories

Resources