Fixing Android AVD libgl Errors On Debian Stretch

Early last year I wrote a few Cordova applications on a system running Debian Linux and wrote about my experiences using the command-line tools here. This year I would like to learn more about "plain-old" Android development using Java, so I'm familiarizing myself with Google's new standard for development, Android Studio.

Of course, there's a few strange gotchas about running this incredibly powerful and complex tool on top of Debian. One of them is that you will get crazy libgl errors when you first try to launch an emulator that look something like this:

Emulator: libGL error: unable to load driver:

At first I thought that I didn't install OpenGL on my laptop, but I did. Then I found the following forum post:

I'm running a 64-bit system, so here's all I had to do:

mv $HOME/Android/Sdk/emulator/lib64/libstdc++/ $HOME/Android/Sdk/emulator/lib64/libstdc++/
ln -s /usr/lib/x86_64-linux-gnu/  $HOME/Android/Sdk/emulator/lib64/libstdc++/

The next time I started my emulator everything worked perfectly (albeit very slowly).

Last Updated .