15

I have installed Eclipse 4.2 with Eclipse android plugin(ADT)on ubuntu 11.10. when i launch "Hello World" project as an android application, it simply wont launch!

ps -x > log.txt after launching the emulator, output:

1000      7221 20.0  0.6  16884  6908 ?        D    18:11   0:00 /home/tutakhail/android-sdks/tools/emulator-arm -avd AndroidBrowser -netspeed full -netdelay none

launching the emulator manually from shell, i get the following error, shortly after which the emulator launches but is very slow.

emulator: ERROR: Could not load OpenGLES emulation library: libOpenglRender.so:    cannot open shared object file: No such file or directory
emulator: WARNING: Could not initialize OpenglES emulation, using software renderer.

Any hints on what could be the issue here? Perhaps related to Ubuntu?

tutak
  • 1,120
  • 1
  • 15
  • 28
  • i have the same problem with an updated adt. since then i cant start any emulator. None of the answers below helped, also non of the answers in other threads :/ is there any solution yet? – reox Aug 03 '12 at 11:11
  • @reox Please check if my answer can help you, atleast temporarily till the issue is figured out. – tutak Aug 10 '12 at 17:46
  • nope i dont even have a nvidia card... :( – reox Aug 11 '12 at 07:51
  • Workaround: Take a backup of the emulator. Make a copy of the emulator-arm and rename it as as emulator. GPU features will then be emulated by software. – BZ1 Aug 15 '12 at 17:20

11 Answers11

15

Turns out the solution is to point LD_LIBRARY_PATH to the /tools/lib path. Below works for me.

➜ tools file ../tools/lib/libOpenglRender.so ../tools/lib/libOpenglRender.so: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, not stripped

➜ tools export LD_LIBRARY_PATH=/home/xxxx/devel/android-sdk-linux/tools/lib:$LD_LIBRARY_PATH

➜ tools ./emulator-x86 -avd AtomX86 -gpu on -qemu -m 1024 -enable-kvm

emulator: emulator window was out of view and was recentered ....

parry
  • 504
  • 3
  • 9
  • Thanks for the reply, this is what i did according to what you said: 1.in shell: export LD_LIBRARY_PATH="/path/to/android-sdk/lib" to make it permanent 2. sudo gedit /etc/ld.so.conf.d/your_lib.conf where i added the path to the /lib and finally updated the cache: 3. sudo ldconfig although i dont get the pervious error anymore, now i get a "segmentation fault" when i launch the emulator from CLI, obviously i cant make it run from eclipse AVD manager – tutak Jul 29 '12 at 19:57
  • The directory to put in LD lib path should be tools/lib not lib as you wrote. But if that isn't the issue then it might just be that GPU acceleration isn't compatible with your gpu / software. ( I have had it crash on one machine and wok on other.) – parry Jul 31 '12 at 03:52
  • Yes i did put the LD path as Path to/android-sdk/tools/lib. My GPU is Nvidia, i have been reading that a combination of Ubuntu+NVIDIA can cause these errors. I will post the solution back in if i resolve the issue. – tutak Jul 31 '12 at 10:25
5

I guess its a bug affecting the latest versions of the ADTs perhaps has something to do with NVIDIA GPUs drivers. The issue is discussed here:

https://groups.google.com/forum/?fromgroups#!topic/adt-dev/nlA07toW1fc

The work around that I have found which at least lets me execute my applications till a permanent solution is released, is that by first launching the emulator from shell even if it throws the error. After which i right-click and run my projects as an "Android application". The emulator does surprisingly execute them!

tutak
  • 1,120
  • 1
  • 15
  • 28
4

I've got similar error, and I guess this error caused by missing libGL.so.

Install package libgl1-mesa-dev;

sudo apt-get install libgl1-mesa-dev

Source

Daniel
  • 3,726
  • 4
  • 26
  • 49
2

Try running emulator from command line first to see if everything goes well. You may need to add options like:

-no-audio 
-gpu off

I've seen audio preventing emulator to start on some Ubuntu configurations.

Diego Torres Milano
  • 65,697
  • 9
  • 111
  • 134
2

I tried to use the Intel Hardware Acceleration in Ubuntu 12.04 for running emulators using KVM package. However I was getting the error, "Failed to start RenderThread". Installing the package libgl1-mesa-dev and reducing the Device RAM Size to 512 solved my problem. The emulator now is indeed atleast 10X faster. I hope this would help someone trying to emulate android devices in Ubuntu using Intel processor that supports Virtualizattion Technology.

thethakuri
  • 509
  • 5
  • 16
1

SO i guess maybe you haven't installed everything properly.

You should check if you followed the steps as shown in : http://www.wikihow.com/Install-Android-on-Ubuntu-Linux-With-Eclipse-Ide

After installing it properly and setting up the PATH environment variables . Also another thing you can do is try deleting the AVD emulator and creating a new one and then try again .

Also i found your question over here at : https://groups.google.com/forum/?fromgroups#!topic/adt-dev/nlA07toW1fc

THe question you asked is not really specific so just try following the steps.

Android2390
  • 1,150
  • 12
  • 21
  • Sorry I'm a total noob - how do you set up the LD_LIBRARY_PATH variable? I'm on Mac OS X trying to follow the "set LD_LIBRARY_PATH" instruction while running the Android SDK in Eclipse but can't find how to do this... can someone tell me? – dkugappi Feb 13 '13 at 22:46
  • In my case, the AVD was created by another SDK and I had to delete it and add it again. – V G Jan 24 '14 at 21:15
  • @DenisKugappi: Rought OS X equivalents are DYLD_LIBRARY_PATH and DYLD_FALLBACK_LIBRARY_PATH; see [here](http://stackoverflow.com/questions/3146274/is-it-ok-to-use-dyld-library-path-on-mac-os-x-and-whats-the-dynamic-library-s). – echristopherson Feb 01 '14 at 21:26
1

If using eclipse, you have to add in Project-Properties in the "Java Build Path" -> Libraries -> Android 4.4 -> "Native library location" the path to sdk/tools/lib directory. For me this is "install-dir-of-sdk"/sdk/tools/lib"

Valery Viktorovsky
  • 6,487
  • 3
  • 39
  • 47
1

The following command saved my life with the same problem

sudo apt-get install libgl1-mesa-dev
kamil
  • 460
  • 7
  • 20
1

Configure ANDROID_HOME

export ANDROID_HOME=//android-sdk-macosx
export PATH=${PATH}:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools

and set LD_LIBRARY_PATH

export LD_LIBRARY_PATH="$ANDROID_HOME/emulator/lib64:$LD_LIBRARY_PATH"

To run ARM version

cd $ANDROID_HOME/emulator/
./emulator64-arm -avd Nexus_5X_ARM_22 -no-audio -gpu off

0

I solved this on my Red Hat Linux 64 bit by installing the 32bit libGL (it should be located in /usr/lib/)

 sudo yum install mesa-libGL.i686
GMLewisII
  • 366
  • 1
  • 7
0

libOpenglRender.so and other necessary files are present, indeed, in tools/lib64, while avd tries to find them in tools/lib Making symbolic links to the files and dirs helped (in my case)

ln -s ../lib64/qt qt
ln -s ../lib64/gles_mesa gles_mesa
ln -s ../lib64/libstdc++ libstdc++
ln -s ../lib64/lib64GLES_V2_translator.so lib64GLES_V2_translator.so
ln -s ../lib64/lib64emugl_test_shared_library.so lib64emugl_test_shared_library.so
ln -s ../lib64/lib64OpenglRender.so lib64OpenglRender.so
ln -s ../lib64/lib64GLES_CM_translator.so lib64GLES_CM_translator.so
ln -s ../lib64/lib64EGL_translator.so lib64EGL_translator.so

(seems to be bug in original config, as that happens with fresh install of the studio/sdk)