android-studio - Android 模拟器不适用于 Ubuntu 16.10

标签 android-studio ubuntu react-native android-emulator ubuntu-16.04

我使用的是配备 Intel 2117U 处理器和 6GB 内存的 Acer Aspire E1-530。

我遵循了 React Native Website 中给出的步骤安装 React Native 和 Android Studio 2.3,并按照 this Ubuntu documentation 中的说明安装 KVM . Android Studio 启动没有问题,我能够成功设置 AVD,但是当我启动 AVD 时,一个小窗口会显示一秒钟然后消失。我还尝试从 ~/Android/Sdk/tools 运行 emulator,但它显示此错误:

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
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:  55
  Current serial number in output stream:  54
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
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:  55
  Current serial number in output stream:  54
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
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:  39
  Current serial number in output stream:  40
QObject::~QObject: Timers cannot be stopped from another thread
Segmentation fault (core dumped)

当我运行 emulator-check accl 时,我得到以下输出:

accel:
0
KVM (version 12) is installed and usable.
accel

最佳答案

将模拟器的 libstdc++.so 替换为您自己的:

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/libstdc++.so  ~/Android/Sdk/emulator/lib64/libstdc++/

关于android-studio - Android 模拟器不适用于 Ubuntu 16.10,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42872128/

相关文章:

reactjs - React + Redux + Normalizr api 请求错误处理

android - 显示所选 API 的文档

android - 我可以在更新完成后删除名为 ".AndroidStudio3.0"的文件夹吗?

android - 如何同时使用新的Android 2.0 Shrinker 和Resource Shrinker?

php - 如何从 PHP 脚本暂停/重启 Linux Ubuntu?

ubuntu - ImageMagick 无法在 Ubuntu 上使用 PNG 支持进行编译

javascript - 如何使用 React-Native 连接 MS SQL 数据库?

android - 文件不从 Android 中的 url 下载

javascript - 从命令行打开 Chrome/Chromium 并将 javascript 操作发送到 chrome/chromium 控制台

react-native - 如何在App Store中的 “Ready for Sale”连接时上传ipa