Cannot start emulator in android studio 2.0

I just updated my android studio from 1.5 to 2.0. And now, before trying to start the emulator, I ran into some strange error. I am using Ubuntu 15.10 OS

Android monitor returns this message

sh: 1: glxinfo: not found sh: 1: glxinfo: not found libGL error: unable to load driver: r600_dri.so libGL error: driver pointer missing libGL error: failed to load driver: r600 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 QObject::~QObject: Timers cannot be stopped from another thread 

When I used version 1.5, everything went well. This is a bug in android studio 2.0.

How to remove this error?

+65
android
Apr 11 '16 at 4:31 on
source share
14 answers

Make sure you install lib64stdc ++ 6 on your system

With a 32-bit operating system:

 # apt-get install lib64stdc++6 

With a 64-bit operating system with reusable support enabled:

 # apt-get install lib64stdc++6:i386 

Then bind the new installed libraries to the sdk tools path for android.

 $ cd $ANDROID_HOME/android-sdk-linux_x86/tools/lib64/libstdc++ $ mv libstdc++.so.6 libstdc++.so.6.bak $ ln -s /usr/lib64/libstdc++.so.6 $ANDROID_HOME/android-sdk-linux_x86/tools/lib64/libstdc++ 

EDIT: at 15.10 x64 with current Sdk (23) folder $ANDROID_HOME/Sdk

+193
Apr 12 '16 at 9:22
source share
— -

Another solution for me was to use system libraries:

emulator -use-system-libs -avd YOUR_VIRTUAL_DEVICE_NAME

+25
Jul 25 '16 at 12:28
source share

I had the same problem in an Arch Linux box. I had to do two things to solve all the problems:

  • Install mesa-demos . This is the Arch Linux package containing glxinfo :

     $ sudo pacman -S mesa-demos 
  • Run the emulator with the -use-system-libs flag:

     $ emulator -avd <AVD name> -use-system-libs 

    To enable this behavior in Android Studio, I set the ANDROID_EMULATOR_USE_SYSTEM_LIBS enviornment variable to ~/.zshrc .

     export ANDROID_EMULATOR_USE_SYSTEM_LIBS=1 

    You can also set this to ~/.profile or ~/.bashrc . In all of these cases, you will need to start Android Studio from the command line. Alternatively, you can set it to ~/.pam_environment to launch Android Studio from the launchpad:

     ANDROID_EMULATOR_USE_SYSTEM_LIBS=1 
+22
Nov 24 '16 at 15:45
source share

After completing the two steps above, install mesa-utils if it is not installed.

$ sudo apt-get install mesa-utils

+17
May 22, '16 at 0:00
source share
 $ cd Android/Sdk/emulator/lib64/libstdc++ $ mv libstdc++.so.6 libstdc++.so.6.bak $ ln -s /usr/lib64/libstdc++.so.6 

it worked for me

+13
May 19, '17 at 3:52 p.m.
source share

Same issue for me on Ubuntu 16.04 LTS x64 with:

  • Android Studio 2.2.3
  • Android SDK Tools 25.2.4
  • Emulator Version 25.2.4-3534729 (From Emulator> Advanced Controls> Help> About)

My graphics card is AMD / ATI Radeon, and I read from this thread in the Android Open Source Project - Issue Tracker, which:

The root cause of the problem is the likelihood that the Radeon GL driver library requires a later libstdc ++. so complete with emulator.

Here is how I fixed the problem:

  • Install lib64std ++ 6

     $ sudo apt-get install lib64stdc++6:i386 
  • Install mesa-demos

     $ sudo apt-get install mesa-utils 
  • Move libstdc ++. so.6 aside, renaming it to libstdc ++. so.6.bak

     $ cd ~/$ANDROID_HOME/Android/Sdk/tools/lib64/libstdc++ $ mv libstdc++.so.6 libstdc++.so.6.bak 
+9
Dec 13 '16 at 16:25
source share

after updating to build tools 25.3.1 libstdc++.so.6 file was moved to $ANDROID_HOME/Sdk/emulator/lib64/libstdc++/libstdc++.so.6

+2
Mar 02 '17 at 8:31 on
source share
 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 

Give it a try!

+1
Mar 05 '18 at 9:19
source share

In an emergency, your KVM resources may be busy due to other running VirtualBox virtual machines.

(I ran into this problem).

To overcome this problem, I used Genymotion instead of Android Emulator.

Then I could run Genymotion along with other VirtualBox virtual machines.

0
Dec 24 '16 at 2:48
source share

Fix Ubuntu 16 LTS Errors

1.Install lib64stdC ++ 6

 sudo apt-get install lib64stdc++6:i386 

2.Install mesa-demos

 sudo apt-get install mesa-utils 
0
Jan 26 '17 at 6:50
source share
 sudo apt-get install mesa-utils 

Link: https://github.com/beidl/prime-indicator/issues/6

0
Feb 01 '17 at 9:27
source share

All of the above answers did not work for me, because "Android Emulator" was not installed with the standard installation of Android Studio. Make sure you install it, and then try the answer above. enter image description here

0
May 30 '17 at 15:27
source share

I had the same problem and the solution did not work for me.

The solution that worked for me told Android Studio about using system libraries instead of the built-in library, editing $ HOME / .profile and adding the following line: export ANDROID_EMULATOR_USE_SYSTEM_LIBS=1 , and then re-logged.

0
Dec 15 '17 at 19:57
source share

Create a new AVD or edit an existing one and change the graphics of Emulated Performance Graphics from automatic to software

enter image description here

0
Feb 28 '18 at 10:15
source share



All Articles