After setting up a new Ubuntu 17.04 system with Android Studio 3.0 Canary 1, I wasn't able to launch the Android emulator. The console error message showed:

Emulator: libGL error: unable to load driver: i965_dri.so
Emulator: libGL error: driver pointer missing
Emulator: libGL error: failed to load driver: i965
Emulator: libGL error: unable to load driver: i965_dri.so
Emulator: libGL error: driver pointer missing
Emulator: libGL error: failed to load driver: i965
Emulator: libGL error: unable to load driver: swrast_dri.so
Emulator: libGL error: failed to load driver: swrast
Emulator: X Error of failed request:  BadValue (integer parameter out of range for operation)
Emulator: Major opcode of failed request:  155 (GLX)
Emulator: Minor opcode of failed request:  24 (X_GLXCreateNewContext)
Emulator: Value in failed request:  0x0
Emulator: Serial number of failed request:  39
Emulator: Current serial number in output stream:  40
Emulator: Process finished with exit code 1

It looks like there is an open defect to track the issue. In the meantime, the fixes that worked for me were:

Option 1

cd ~/Android/Sdk/emulator/lib64/libstdc++
mv libstdc++.so.6 libstdc++.so.6.bak
ln -s /usr/lib64/libstdc++.so.6

Steps above must be repeated for each emulator update.

Option 2

Instead of manually removing the bundled libs on disk, there is a flag called -use-system-libs. Although, I didn't see it exposed through the Android Studio UI.

~/Android/Sdk/tools/emulator @Pixel_XL_API_25 -use-system-libs

Comments

comments powered by Disqus