Failed to load libGL.so on Android

前端 未结 26 1406
旧巷少年郎
旧巷少年郎 2020-12-04 06:05

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:

[201         


        
26条回答
  •  青春惊慌失措
    2020-12-04 06:58

    To make it work on a Ubuntu 12.10 (Quantal Quetzal) 64-bit, you have to do two things:

    1) You have to initialize LD_LIBRARY_PATH

    Example:

    export LD_LIBRARY_PATH=~/tests/android/adt-bundle-linux-x86_64/sdk/tools/lib
    

    Comments: change the path to your location

    2) You have to create a symbolic link

    a) Use locate libGL to find the correct library:

    rudy@vsolutions:~$ locate libGL
    /home/rudy/opt/android/android-sdk-linux/tools/lib/libGLES_CM_translator.so
    /home/rudy/opt/android/android-sdk-linux/tools/lib/libGLES_V2_translator.so
    /usr/lib/i386-linux-gnu/libGLU.so.1
    /usr/lib/i386-linux-gnu/libGLU.so.1.3.1
    ...
    /usr/lib32/nvidia-current/libGL.so.304.43
    

    b) Create the soft link

    sudo ln -s /usr/lib/x86_64-linux-gnu/mesa/libGL.so.1.2.0 /usr/lib/libGL.so
    

    Comments: use a 64-bit library on a 64-bit operating system!

    Now start the emulator My system is Optimus, and I have installed Bumblebee. I can use "Intel Open Source Technology Center" "Mesa DRI Intel(R) Ironlake Mobile " "2.1 Mesa 9.0" or "NVIDIA Corporation" "GeForce GT 330M/PCIe/SSE2" "3.3.0 NVIDIA 304.43".

    a) Intel

    /home/rudy/tests/android/adt-bundle-linux-x86_64/sdk//tools/emulator64-arm -avd avd_42 -scale 0.46 -gpu on -verbose
    

    b) Nvidia

    optirun /home/rudy/tests/android/adt-bundle-linux-x86_64/sdk//tools/emulator64-arm -avd avd_42 -scale 0.46 -gpu on -verbose
    

    Comments:

    • I didn't see any difference between the Intel and the Nvidia cards... It is certainly because the emulator is not GPU intensive.
    • On my system an Intel Core i5, it took almost 1 minute to start the emulator... Please be patient... I find the emulator rather fast after it is loaded (the 1 minute to wait). If you start the emulator from the Eclipse IDE, then the emulator does a software emulation (the GPU is off) and took 1 min 30 to start... It is much more slower than using the Intel or Nvidia cards!!!
    • verbose is the parameter to use to display more diagnostics
    • optirun is the command to make use of the Nvidia on Bumblebee. If you don't have Bumblebee don't use it!
    • avd is a virtual device
    • gpu on to make use of the graphical card

提交回复
热议问题