8

i'm using android studio 2.0 in ubuntu 16.04 and don let me run the emulator avd because apparently it lacks a driver. How i could solve this problem?

this is the exception that throws after i run the emulator

Cannot launch AVD in emulator.

Output:
libGL error: unable to load driver: radeonsi_dri.so
libGL error: driver pointer missing
libGL error: failed to load driver: radeonsi
libGL error: unable to load driver: swrast_dri.so
libGL error: failed to load driver: swrast
X Error of failed request:  GLXBadContext
  Major opcode of failed request:  155 (GLX)
  Minor opcode of failed request:  6 (X_GLXIsDirect)
  Serial number of failed request:  49
  Current serial number in output stream:  48
libGL error: unable to load driver: radeonsi_dri.so
libGL error: driver pointer missing
libGL error: failed to load driver: radeonsi
libGL error: unable to load driver: swrast_dri.so
libGL error: failed to load driver: swrast
X Error of failed request:  GLXBadContext
  Major opcode of failed request:  155 (GLX)
  Minor opcode of failed request:  6 (X_GLXIsDirect)
  Serial number of failed request:  49
  Current serial number in output stream:  48
libGL error: unable to load driver: radeonsi_dri.so
libGL error: driver pointer missing
libGL error: failed to load driver: radeonsi
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
emulator: WARNING: VM heap size set below hardware specified minimum of 128MB
emulator: WARNING: Setting VM heap size to 384MB

Would appreciate any response!

Fabian N.
  • 3,807
  • 2
  • 23
  • 46
Juan_H
  • 367
  • 4
  • 15

3 Answers3

6

Well , i found a solution for this problem. I don't know what it's wrong with Android Studio but he can't execute the any emulator and the solution for me nowadays is execute the emulator by command,after that you install a emulator using android studio execute the command below because you need to have the emulator, in my case Nexus_5_API_21.

LD_PRELOAD='/usr/lib/x86_64-linux-gnu/libstdc++.so.6' ~/Android/Sdk/tools/emulator -netdelay none -netspeed full -avd Nexus_5_API_21

i don't remeber exactly where i found this solution but i think it's on google forums

Juan_H
  • 367
  • 4
  • 15
4

I am also using Android Studio 2.1 with Ubuntu 16.04

There is an answer from this stackoverflow question that worked perfectly.

A few things to note: My $ANDROID_HOME was different then this one. I had to take out the android-sdk-linux_x86 in the filename. Also there was multiple versions of libstdc++.so.6 libstdc++.so.6.0.18 and libstdc++.so.6.0.21. I still used the libstdc++.so.6 and it worked perfectly

$ 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++
Community
  • 1
  • 1
ChrisR
  • 607
  • 6
  • 16
  • In my case, I just deleted `$PATH_TO_ANDROID_SDK/tools/lib64/libstdc++/libstdc++.so.6` and everything started working fine. You may also fine more variants there, like 6.0.18 and 6.0.21, delete them too. – AneesAhmed777 Dec 30 '16 at 14:39
2

What I did to solve this on my Xubuntu 16.04 was :

  • Check what my graphics card is with: lspci | grep VGA
    • answer: some NVidia model
  • Check what graphics driver I was currently using with: sudo lshw -C video | grep driver
    • answer: the Nouveau default, free software driver
  • Installed proprietary NVidia driver : go to Main search menu (depending on your Unity, or Gnome, or Xfce) > Additional drivers > switch from "Nouveau" to "NVIDIA binary driver - version 3XX (proprietary, tested) enter image description here
  • Reboot

And my Android emulator errors were gone :)

Community
  • 1
  • 1
Deleplace
  • 6,812
  • 5
  • 28
  • 41