Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error libGL.so: cannot open shared object file using Android emulator

I was trying to run android emulator in Ubuntu 12.04(64-bit). But, I got the following errors.

Starting emulator for AVD 'emulatr'
Failed to load libGL.so
error libGL.so: cannot open shared object file: No such file or directory
Failed to load libGL.so
error libGL.so: cannot open shared object file: No such file or directory
emulator: emulator window was out of view and was recentered

After using locate libGL. I found

/home/adnan/android-sdk-linux/tools/lib/libGL.so
/usr/lib/libGL.so
/usr/lib/i386-linux-gnu/libGL.so
/usr/lib/i386-linux-gnu/mesa/libGL.so
/usr/lib/i386-linux-gnu/mesa/libGL.so.1
/usr/lib/i386-linux-gnu/mesa/libGL.so.1.2.0
/usr/lib/x86_64-linux-gnu/mesa/libGL.so.1
/usr/lib/x86_64-linux-gnu/mesa/libGL.so.1.2.0

I also tried some solution from this question But, didn't work. I will be glad, if you guys help to solve this problem.

like image 578
Adnan Avatar asked Jul 02 '13 04:07

Adnan


4 Answers

http://learnedstuffs.wordpress.com/2012/07/17/fixing-ubuntu-error-failed-to-load-libgl-so/

apt-get install libgl1-mesa-dev

worked for me

like image 117
Researcher Avatar answered Nov 03 '22 20:11

Researcher


On Fedora

sudo yum install mesa-libGL-devel
like image 29
MariuszS Avatar answered Nov 03 '22 19:11

MariuszS


As I'm using 64-bit Ubuntu 12.04. So, I did 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
like image 8
Adnan Avatar answered Nov 03 '22 19:11

Adnan


This works for me on Ubuntu 14.04 64-bit:

$ sudo apt-get install libgl1-mesa-dri
$ sudo ln -sv /usr/lib/x86_64-linux-gnu/mesa/libGL.so.1 /usr/lib/x86_64-linux-gnu/libGL.so
like image 3
Stephan Henningsen Avatar answered Nov 03 '22 19:11

Stephan Henningsen