Thursday, 2 February 2017

Android Studio AVD issue in Ubuntu 16.10

As you all know Android Studio is the IDE used for developing android applications. Android Studio has a lot of built-in components and one of the most useful of them is your Android Virtual Device(AVD) Emulator. It helps you to test your applications in an easy way and without using a real device.
Now after downloading and setting up your Android Studio on your Ubuntu 16.10, you might face a problem saying something like:

Cannot launch AVD in emulator.
Output:
libGL error: unable to load driver: radeonsi_dri.so
libGL error: driver pointer missing
libGL error: unable to load driver: i965_dri.so
libGL error: driver pointer missing
libGL error: unable to load driver: r600_dri.so
libGL error: driver pointer missing
libGL error: unable to load driver: swrast_dri.so
libGL error: failed to load driver: swrast
X Error of failed request:  BadValue (integer parameter out of range for operation)
  Major opcode of failed request:  155 (GLX)
  Minor opcode of failed request:  24 (X_GLXCreateNewContext)
  Value in failed request:  0x0
  Serial number of failed request:  33
  Current serial number in output stream:  34

or may be saying: Unable to work with the Android Emulator.

This is basically a libGL error and libstdc++ issue.
It’s a known bug and you can easily fix it with some simple steps as follows:

1. First install some packages and libs:
    Type the following in your terminal

          $ sudo apt-get install lib64stdc++6:i386  

          $ sudo apt-get install mesa-utils  


2. Second, proceed with these commands:

         $ cd YOURPATH/Android/Sdk/tools/lib64  // In my case YOURPATH = /home/nishant  

         $ mv libstdc++/ libstdc++.bak  

         $ ln -s /usr/lib64/libstdc++.so.6  libstdc++  

3. Now relaunch your AVD device and test it.

That's all.
Its a tested solution for Ubuntu 16.10 64bit.

Comment if any issues.







5 comments:

  1. If libstdc++ not found at Android/Sdk/tools/lib64

    Run emulator from terminal

    $ emulator -use-system-libs -avd YOUR_VIRTUAL_DEVICE_NAME

    ReplyDelete
  2. I really enjoy reading your article. I wanted to inform you that you have people like me who appreciate your work. Definitely a great post I'd like to read this.
    gamecube emulator download for android

    ReplyDelete
  3. i am getting no such file or directory when i enter the second procedure

    ReplyDelete
    Replies
    1. Please make sure whether you have Android/Sdk directory on your machine or not. The above mentioned path is for ubuntu machine.

      Delete