Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Failed to load libGL.so on Android

Tags:

android

I am using Ubuntu 12.04 (Precise Pangolin) with the Oracle JDK 7, and when I am running the Android emulator from Eclipse, it's giving this error:

[2012-07-04 02:52:10 - Emulator] error libGL.so: cannot open shared object file: No such file or directory 
[2012-07-04 02:52:10 - Emulator] Failed to load libGL.so

Also the emulator is very slow. How can I solve this problem?

like image 541
php.khan Avatar asked Jul 04 '12 16:07

php.khan


4 Answers

I have the Android SDK installed into ~/android-sdk-linux_x86, so I did:

ln -s /usr/lib/libGL.so.1 ~/android-sdk-linux_x86/tools/lib/libGL.so

This solves errors just like linking to /usr/lib does, but it doesn't require root and doesn't mess with core system directories.

like image 189
user1410657 Avatar answered Oct 14 '22 05:10

user1410657


On 64-bit Ubuntu 12.04, do it like this:

$ sudo apt-get install git-core gnupg flex bison gperf build-essential \
  zip curl libc6-dev libncurses5-dev:i386 x11proto-core-dev \
  libx11-dev:i386 libreadline6-dev:i386 libgl1-mesa-glx:i386 \
  libgl1-mesa-dev g++-multilib mingw32 openjdk-6-jdk tofrodos \
  python-markdown libxml2-utils xsltproc zlib1g-dev:i386
$ sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so

Source: Installing required packages (Ubuntu 12.04)

like image 38
libo Avatar answered Oct 14 '22 05:10

libo


I am using Ubuntu 12.04 64-bit. Using the following command to solve the problem

 sudo ln -s /usr/lib32/fglrx/libGL.so.1.2 /usr/lib/libGL.so

Note: This is applicable only to those who use the AMD/ATI graphic drivers.

like image 32
user1289608 Avatar answered Oct 14 '22 05:10

user1289608


For 32-bit Ubuntu 12.04 LTS, this worked:

sudo apt-get install libgl1-mesa-dev

None of the following worked:

cd /usr/lib/i386-linux-gnu/mesa/
sudo ln -s libGL.so.1.2 libGL.so 
sudo ln -s libGL.so.1.2 /usr/lib/libGL.so
ln -s libGL.so.1.2 ~/android/android-sdk-linux/tools/lib/libGL.so
like image 32
Wood Dragon Avatar answered Oct 14 '22 05:10

Wood Dragon