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

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.

Related

custom android 11 update

I try to develop an android system, I have some problems with development.
I get used to ubuntu18 and tag of android 11 is android-11.0.0_r17,
I have built successfully with lunch 30 "aosp_x86-eng" and I have seen $OUT files and checked
then I prepared test_aosp.sh file under ~/bin
the results are like that and no emulator window appears:
$ ./test_aosp.sh
emulator: Android emulator version 30.0.21.0 (build_id 6647651) (CL:N/A)
emulator: Found AVD name 'a25x86'
emulator: Found AVD target architecture: x86
emulator: argv[0]: 'emulator'; program directory: '/home/ubuntu/aosp/prebuilts/android-emulator/linux-x86_64'
PANIC: Cannot find AVD system path. Please define ANDROID_SDK_ROOT
the content of test_aosp.sh is :
#!/bin/sh
emulator -avd a25x86 -verbose -show-kernel -system $OUT/system.img -ramdisk $OUT/ramdisk.img -initdata $OUT/userdata.img
when I checked ROGER YE notes, before that partition he had run ~/Android/Sdk/emulato/emulator #a25x86, also I did it with the last version of android studio.
Also, I try to do the following thing but is has a loop in the command line and the black window of emulator shows up but not appear any menu and any more:
$ sudo ~/Android/Sdk/emulator/emulator -avd a25x86 -verbose -show-kernel -system $OUT/system.img -ramdisk $OUT/ramdisk.img -initdata $OUT/userdata.img
also I have checked the emulator location with the following command:
$ which emulator
/home/ubuntu/aosp/prebuilts/android-emulator/linux-x86_64/emulator
also I want to add following results, maybe you want to check it:
$ printenv |grep ANDROID
ANDROID_DEV_SCRIPTS=/home/ubuntu/aosp/development/scripts:/home/ubuntu/aosp/prebuilts/devtools/tools:/home/ubuntu/aosp/external/selinux/prebuilts/bin:/home/ubuntu/aosp/prebuilts/misc/linux-x86/dtc:/home/ubuntu/aosp/prebuilts/misc/linux-x86/libufdt
ANDROID_TOOLCHAIN_2ND_ARCH=
ANDROID_PRE_BUILD_PATHS=/home/ubuntu/aosp/prebuilts/jdk/jdk11/linux-x86/bin:
ANDROID_HOST_OUT_TESTCASES=/home/ubuntu/aosp/out/host/linux-x86/testcases
ANDROID_JAVA_TOOLCHAIN=/home/ubuntu/aosp/prebuilts/jdk/jdk11/linux-x86/bin
ANDROID_TARGET_OUT_TESTCASES=/home/ubuntu/aosp/out/target/product/generic_x86/testcases
ANDROID_BUILD_TOP=/home/ubuntu/aosp
ANDROID_BUILD_PATHS=/home/ubuntu/aosp/out/soong/host/linux-x86/bin:/home/ubuntu/aosp/out/host/linux-x86/bin:/home/ubuntu/aosp/prebuilts/gcc/linux-x86/x86/x86_64-linux-android-4.9/bin:/home/ubuntu/aosp/development/scripts:/home/ubuntu/aosp/prebuilts/devtools/tools:/home/ubuntu/aosp/external/selinux/prebuilts/bin:/home/ubuntu/aosp/prebuilts/misc/linux-x86/dtc:/home/ubuntu/aosp/prebuilts/misc/linux-x86/libufdt:/home/ubuntu/aosp/prebuilts/clang/host/linux-x86/llvm-binutils-stable:/home/ubuntu/aosp/prebuilts/android-emulator/linux-x86_64:/home/ubuntu/aosp/prebuilts/asuite/acloud/linux-x86:/home/ubuntu/aosp/prebuilts/asuite/aidegen/linux-x86:/home/ubuntu/aosp/prebuilts/asuite/atest/linux-x86:
ANDROID_EMULATOR_PREBUILTS=/home/ubuntu/aosp/prebuilts/android-emulator/linux-x86_64
ANDROID_PRODUCT_OUT=/home/ubuntu/aosp/out/target/product/generic_x86
ANDROID_PYTHONPATH=/home/ubuntu/aosp/development/python-packages:
ANDROID_TOOLCHAIN=/home/ubuntu/aosp/prebuilts/gcc/linux-x86/x86/x86_64-linux-android-4.9/bin
ANDROID_JAVA_HOME=/home/ubuntu/aosp/prebuilts/jdk/jdk11/linux-x86
ANDROID_HOST_OUT=/home/ubuntu/aosp/out/host/linux-x86
Could you guide me?
Thank you
Regards
if you successfully built, you can run emulator without additional arguments. Just typing emulator in console.
Or, please try to set ANDROID_SDK_ROOT as suggested.
export ANDROID_SDK_ROOT=/path/to/your/sdk/for/avd

-list-avds then launch results in PANIC

I listed the emulators using:
emulator -list-avds
Attempt to launch an emulator:
emulator -avd Pixel_XL_API_25
And terminal replies:
PANIC: Unknown AVD name [Pixel_XL_API_25], use -list-avds to see valid list.
ANDROID_AVD_HOME is defined but could not find Pixel_XL_API_25.ini file in $ANDROID_AVD_HOME
(Note: avd is searched in the order of $ANDROID_AVD_HOME,$ANDROID_SDK_HOME/.android/avd and $HOME/.android/avd)
The path actually seems off:
echo $ANDROID_AVD_HOME
Produces:
/Users/alex/.android
Which should be: /Users/alex/.android/avd
Fixed that, new exception:
[140737069994944]:ERROR:./android/qt/qt_setup.cpp:28:Qt library not found at ../emulator/lib64/qt/lib
Could not launch '../emulator/qemu/darwin-x86_64/qemu-system-i386': No such file or directory
Does anyone know how to resolve this?
A solution that worked helped was to update my bash profile:
export ANDROID_HOME=${HOME}/Library/Android/sdk
export PATH=${PATH}:${ANDROID_HOME}/emulator
Could not launch emulator in Android Studio
Note:
I still can't use the GUI integrated into Android Studio. I have to run the emulator command:
sudo emulator -avd Nexus_Emulator

Android emulator64-x86 hangs during the boot process

I'm using a 64bits Debian and when I try to run this:
$ emulator64-x86 -verbose -avd cocos2dx-emulator -gpu on -qemu -m 2047 -enable-kvm
The process just hangs and the only way to stop it is using kill -9, these are the last output lines it prints:
[...]
emulator: trying to find: /home/victor/lab/androidr16/android-sdk-linux/tools/bios.bin
emulator: trying to find: /home/victor/lab/androidr16/android-sdk-linux/tools/lib/pc-bios/bios.bin
emulator: trying to find: /home/victor/lab/androidr16/android-sdk-linux/tools/vgabios-cirrus.bin
emulator: trying to find: /home/victor/lab/androidr16/android-sdk-linux/tools/lib/pc-bios/vgabios-cirrus.bin
If I use emulator-x86, it works fine:
$ emulator-x86 -verbose -avd cocos2dx-emulator -gpu on -qemu -m 2047 -enable-kvm
[...]
emulator: trying to find: /home/victor/lab/androidr16/android-sdk-linux/tools/bios.bin
emulator: trying to find: /home/victor/lab/androidr16/android-sdk-linux/tools/lib/pc-bios/bios.bin
emulator: trying to find: /home/victor/lab/androidr16/android-sdk-linux/tools/vgabios-cirrus.bin
emulator: trying to find: /home/victor/lab/androidr16/android-sdk-linux/tools/lib/pc-bios/vgabios-cirrus.bin
emulator: autoconfig: -scale 1
emulator: Could not open file: (null)/system/build.prop: No such file or directory
emulator: sent '0012host:emulator:5555' to ADB server
[...]
I don't have any clue about what's going on and I'm not able to find any possible related errors in the system logs.
Any ideas?
A similar bug has been filed in AOSP (see below), although most of us experience the same result with emulator-x86 as well.
As a workaround, try to uninstall KVM and see if the emulator runs. It will obviously be slower since it's not using the VT extensions of your CPU, but it may narrow the source of the problem.
Issue 33817: emulator-x86 + kvm triggers an endless loop in qemu-setup.c
https://code.google.com/p/android/issues/detail?id=33817
Then again, you might only need to run the 32-bit emulators and this might not be an issue at all.
Edit: The issue appears to be caused by a clone() in pulseaudio code called from external/qemu/audio/paaudio.c. A patch that adds the BEGIN_NOSIGALRM guard is available on the Issue 33817 thread, post 16:
https://code.google.com/p/android/issues/detail?id=33817#c16

Eclipse Android SDK ERROR: unknown virtual device name

So, the issue i correctly installed eclipse,android sdk,ndk, coocs2d-x 2.1.4. I can build cocos2d-x android project, import it to eclipse, etc. Everything seems fine, but not really. The problem is that i can't launch my virtual machine to emulate andoid OS. I created avd, it works fine with simple android projects, but when i use it to run cocos2d-x project as android application it does nothing. No output at all. I found this guide and followed it. But i faced a problem. 1st of all, when i follow this step:
Now start the Android for x86 Intel Emulator using the following command:
$ <SDK directory>/tools/emulator-x86 -avd Your_AVD_Name -qemu -m 2047 -enable-kvm
i have an error message:
gloomist-CN tools # ./emulator-x86 #myavd -qemu -m 2047 -enable-kvm
emulator: ERROR: unknown virtual device name: 'myavd'
emulator: could not find virtual device named 'myavd'
But it is in sdk as a valid android virtual device. And the next one. In that tutorial that i pasted link to above, the last step is:
Run the emulator with the correct library path and options
Make sure to
Set the library path to the directory containing the Open GL library for the emulator (LD_LIBRARY_PATH=...)
Run the x86 version of the emulator (run /tools/emulator-x86)
Enable GPU use (Use the option "-gpu on")
Also, you need to specify the name of the Android Virtual Device to use (Use the option "-avd ")
On OS X the command line looks like this
LD_LIBRARY_PATH=~/bin/android-sdk/tools/lib ~/bin/android-sdk/tools/emulator-x86 -verbose -avd android17x86 -gpu on
i don't really know what author meant by all this. Could anyone explain me the way to do it in linux?
So basically, the main problem is: how to run a cocos2d-x project on AVD in eclipse on lixnux? That's it.
I use Linux version 3.2.0-23-generic (buildd#palmer) (gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu4) ) #36-Ubuntu SMP Tue Apr 10 20:41:14 UTC 2012 (Ubuntu 3.2.0-23.36-generic 3.2.14).
Can anyone help me to figure out how can i accurately launch my cocos2d-x project on AVD using eclipse?
Are you sure 'myavd' is a valid avd?
Try to run this command to get a list of AVD's you have created in your system:
# <SDK directory>/tools/android list avd
And re-run emulator-x86 passing a valid avd.
I also suggest you follow the step by step guide about how to configure your android enviroment which comes with cocos2d-x dist. You can find it in: /samples/Cpp/TestCpp/proj.android/README.md
Hope this helps
I was able to fix this error on Ubuntu 18.04 by running:
sudo chmod 777 /dev/kvm
Its not exactly high security, but it gets the job done.

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

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.

Categories

Resources