Search code examples
android-emulatorubuntu-15.10

Cannot launch emulator on Linux (Ubuntu 15.10)


I try to launch emulator but it outputs into log:

libGL error: unable to load driver: r600_dri.so 
libGL error: driver pointer missing 
libGL error: failed to load driver: r600 
libGL error: unable to load driver: swrast_dri.so 
libGL error: failed to load driver: swrast 
X Error of failed request:  GLXBadContext   
Major opcode of failed request:  155 (GLX)
Minor opcode of failed request: 6 (X_GLXIsDirect)
Serial number of failed request:  47
Current serial number in output stream:  46 
libGL error: unable to load driver: r600_dri.so 
libGL error: driver pointer missing 
libGL error: failed to load driver: r600 
libGL error: unable to load driver: swrast_dri.so 
libGL error: failed to load driver: swrast 
X Error of failed request:  GLXBadContext
Major opcode of failed request:  155 (GLX)
Minor opcode of failed request:  6 (X_GLXIsDirect)   
Serial number of failed request:  47   
Current serial number in output stream:  46 
libGL error: unable to load driver: r600_dri.so 
libGL error: driver pointer missing 
libGL error: failed to load driver: r600
libGL error: unable to load driver: swrast_dri.so 
libGL error: failed to load driver: swrast 
X Error of failed request:  BadValue (integer parameter out of range for operation)   
Major opcode of failed request:  155 (GLX)   
Minor opcode of failed request:  24 (X_GLXCreateNewContext)   
Value in failed request:  0x0   
Serial number of failed request:  33   
Current serial number in output stream:  34 
QObject::~QObject: Timers cannot be stopped from another thread emulator: WARNING: Increasing RAM size to 1GB

How to fix it? I read topics with similar errors but it doesn't help me.


Solution

  • Take a look at

    https://code.google.com/p/android/issues/detail?id=197254

    in particular items #3 and #19. This is a workaround rather than a true solution, but it got me moving again. You will have to adjust the command for:

    • the location of the libstdc++.so.6 file on your system - I used locate libstdc++.so.6 to find this
    • the path to the emulator executable
    • the name of your emulator

    so my command was

    LD_PRELOAD='/usr/lib/x86_64-linux-gnu/libstdc++.so.6' ~/Android/Sdk/tools/emulator -netdelay none -netspeed full -avd Nexus_5_API_21
    

    This then launches the emulator, and you can select it in the 'Device Chooser' dialogue when you run your app.