libGL error: unable to load driver: i965_dri.so or GLX generic errors.

If you can’t launch the emulator from Android Studio with hardware emulation enabled because of these errors it’s probably because the AVD is starting using wrong versions of the libraries.

Manually start the emulator and append -use-system-libs as flag, like this:

avivace@debian-tp:~/Android/Sdk/tools$ ./emulator -avd AVD_NAME -use-system-libs

The emulator starts with default console port 5554 and should be automatically seen as available device by Android Studio.

As of 11/13/2016, it’s not possibile to change the default args/flags Android Studio uses to launch the AVD because the Emulator tab is missing from the Configuration dialog (it’s a known bug from Android Studio v1.5).