Saturday, July 27, 2013

Android Emulator error libGL.so: cannot open shared object file: No such file or directory

If you run Android Emulator with the error of "libGL.so: cannot open shared object file: No such file or directory", you have to make link for libGL.so.

My machine run Ubuntu 12.04. The following is my solution to fix it. (assume libGL is installed in somewhere in your system)

- Locate your installed libGL:
$locate libGL

- make link to installed libGL.so
$sudo ln -s /usr/lib/i386-linux-gnu/libGLU.so.1 /usr/lib/libGL.so

locate and ln libGL.so


Remark:
Thanks comment by Anonymous:
~ If your system is 64 bit one, you must link to the 64 bit libGL

4 comments:

  1. I still have the problem :( it didn't solve mine.

    ReplyDelete
  2. I am having this problem while trying to use Android emulator shashlik_0.9.3.deb on Linux Mint 18.

    I tried what you said, that exact problem is gone. but now I have this problem:

    Failed to load libGL.so
    error libGL.so: wrong ELF class: ELFCLASS32
    Failed to load libGL.so
    error libGL.so: wrong ELF class: ELFCLASS32

    ReplyDelete
  3. Look, I found the answer to that problem.

    The error was because my Linux Mint 18 system is x64 bit based system.

    wrong ELF class: ELFCLASS32 means that I linked to libGL x32 bit.

    I deleted that link from /usr/lib and then made link to the proper x64 from "locate libGL"

    I think you should mention that. You should say, if your system is 64 bit one, you must link to the 64 bit libGL.

    ReplyDelete