I recently upgraded from 16.04 LTS where my android studio was working fine to 16.10 but on trying to run my avd emulators, this is the error log i get back instead
Cannot launch AVD in emulator.
Output:
libGL error: unable to load driver: i965_dri.so
libGL error: driver pointer missing
libGL error: failed to load driver: i965
libGL error: unable to load driver: i965_dri.so
libGL error: driver pointer missing
libGL error: failed to load driver: i965
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: 55
Current serial number in output stream: 54
libGL error: unable to load driver: i965_dri.so
libGL error: driver pointer missing
libGL error: failed to load driver: i965
libGL error: unable to load driver: i965_dri.so
libGL error: driver pointer missing
libGL error: failed to load driver: i965
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 r
In the recent android studio updates, google use a
libstdc++
that is incompatible with the intel driver installed on the systemYou first have to install the following packages if there not on the system
lib64stdc++6
andmesa-utils
Then symlink the libraries to the android sdk tools path
I had also this problem on Ubuntu 17.04 and here's what I did.
Edit your
.profile
using your favorite text editorAppend this at the end of the file
Source: Android SDK Environment Variable
Run emulator from terminal
another simple workaround is to rename the libstdc++ in the emulator folder in the Android sdk directory. It will fallback to the system libs (need to be installed). That 'just worked' for me on Ubuntu 17.10.
Update the emulator.
This is a bug which is being fixed in 27.2.9.
FYI: BTW manually creating symlinks is not a good idea.
Setting
ANDROID_EMULATOR_USE_SYSTEM_LIBS
is a better approach. However, that's also not necessary when you could just update the emulator.I switched the graphics acceleration from auto/hardware to software. The drivers that are causing this issue are only needed to use real hardware for graphics acceleration. Unless your working on a game or other graphics intensive software you don't really need this. This has to be done on each adv but stays set once done.
This link help. I did modify the location of the libstdc++.so based on my Ubuntu 17.10 installation. The libstdc++.so file location was different. Search your computer for libstdc++.so
Ubuntu 17.10 and Android Studio 3.1