Are you facing issues with Android Emulator in Ubuntu OS? This post might help to resolve your issue.

Recently, I shifted from Mac to Ubuntu for Android development. I had a couple of issues with the simulator and ADB devices connectivity. To help other developers, I have created this post to resolve library launch issues.

To create an emulator in Android studio – Ubuntu, navigate to tools -> launch AVD Manager

Android Studio AVD Download Virtual devices

  1. Select any device and click on next button at the bottom of the dialog box.
  2. Select API target platform and download the required platform. I recommend downloading the latest version of Android.
  3. Click on Finish.

It should download and make it available to you on the Virtual devices list.

Android AVD Devices List

Now, click on Play button to start the avd and you might experience with error messages like below

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

This error message might differ from PC to PC. Since we have a wide variety of processors like AMD, Intel etc..

This issue is still open in GitHub. But I have turn-around solution which might help to resolve this issue, Please execute the below commands to create a symbolic link to load the emulator.

Exit the studio and execute the below commands in terminal. Assuming that you are using default path for SDK tools in Ubuntu. In case of a different path, please use appropriate path to create a symbolic file.

$ cd ~/Android/Sdk/emulator/lib64/libstdc++
$ mv libstdc++.so.6 libstdc++.so.6.bak
$ ln -s /usr/lib/x86_64-linux-gnu/libstdc++.so.6 libstdc++.so.6

Once it is executed successfully, please restart the android studio and AVD and launch the emulator.

Boom! It will popup emulator window on your screen 🙂

Android Emulator

Tested the above solution in Ubuntu 17.04 and 18.04 versions. Hope it helps.

 

Leave a comment

Your email address will not be published. Required fields are marked *

%d bloggers like this: