无法在Android Studio模拟器中启动AVD

17

Android Studio 2中模拟器出现问题...

无法在模拟器中启动AVD

Output:
libGL error: failed to load driver: nouveau
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:  47
  Current serial number in output stream:  46
libGL error: unable to load driver: nouveau_dri.so
libGL error: driver pointer missing
libGL error: failed to load driver: nouveau
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:  47
  Current serial number in output stream:  46
libGL error: unable to load driver: nouveau_dri.so
libGL error: driver pointer missing
libGL error: failed to load driver: nouveau
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)
emulator: WARNING: VM heap size set below hardware specified minimum of 384MB
  Major opcode of failed request:  155 (GLX)
emulator: WARNING: Setting VM heap size to 384MB
  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

这是控制台上的内容:

错误

运行该命令后,它会给出以下错误信息:bash: cd: /android-sdk-linux_x86/tools/lib64/libstdc++: 没有那个文件或目录

请大家帮忙解决……

3个回答

32
请在 AVD 设置中,选择“模拟性能图形”选项中的“软件”,而非“自动”。
请查看以下截图:screenshot

1
这对我来说解决了“模拟器:libGL错误:无法加载驱动程序:nouveau_dri.so…”的问题,但是当启动模拟器(Nexus_5X_API_27_x86)时,一切都是黑色的,即使我开机了(我是新手,所以可能是一个微不足道的问题)。 - sancho.s ReinstateMonicaCellio

26

使用Sdk路径出现问题.....

Sdk路径链接而不是$ANDROID_HOME

  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++ 

在我的情况下,像使用路径这样

 1. cd Desktop/blackgoogle/Android/Sdk/tools/lib64/libstdc++
 2. mv libstdc++.so.6 libstdc++.so.6.bak
 3. cd
 4. ln -s /usr/lib64/libstdc++.so.6 Desktop/blackgoogle/Android/Sdk/tools/lib64/libstdc++

注意:-pathOfSDK/tools/lib64/libstdc++

可能是Android Studio无法启动模拟器的重复问题


请解释一下那里正在发生什么,我该如何做到这一点。 - Vikas Pandey
@VikasPandey 复制您的 SDK 路径并将其放入 SDKPAth/tools/libstdc++ 中。它会将某些文件从一个文件夹移动到另一个文件夹,并创建该文件的链接(类似于快捷方式文件)。 - sushildlh

5
使用以下三个命令来解决此错误。
mv ~/Android/Sdk/tools/lib64/libstdc++/libstdc++.so.6{,.bak}
mv ~/Android/Sdk/tools/lib64/libstdc++/libstdc++.so.6.0.18{,.bak}
ln -s /usr/lib/libstdc++.so  ~/Android/Sdk/tools/lib64/libstdc++/

2
在Ubuntu 17.04上,路径有点不同:mv ~/Android/Sdk/emulator/lib64/libstdc++/libstdc++.so.6{,.bak}mv ~/Android/Sdk/emulator/lib64/libstdc++/libstdc++.so.6.0.18{,.bak}以及ln -s /usr/lib/gcc/x86_64-linux-gnu/6/libstdc++.so ~Android/Sdk/emulator/lib64/libstdc++/ - bovender
3
在 Ubuntu 17.10 上,路径又发生了变化: mv ~/Android/Sdk/emulator/lib64/libstdc++/libstdc++.so.6{,.bak} mv ~/Android/Sdk/emulator/lib64/libstdc++/libstdc++.so.6.0.18{,‌​.bak} ln -s /usr/lib/gcc/x86_64-linux-gnu/7/libstdc++.so ~Android/Sdk/emulator/lib64/libstdc++/ - Andres de Lago
@Andres 对于复制粘贴者来说,Andres 评论中的最后一行缺少一个 /,在 ~Android 之间。应该是:ln -s /usr/lib/gcc/x86_64-linux-gnu/7/libstdc++.so ~/Android/Sdk/emulator/lib64/libstdc++。 - user5389726598465

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接