我使用了带有Intel 2117U处理器和6GB内存的Acer Aspire E1-530。
我遵循React Native网站中给出的步骤来安装React Native和Android Studio 2.3,并且还安装了这个Ubuntu文档中给出的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 ++。
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++/
从终端运行模拟器
$ emulator -use-system-libs -avd YOUR_VIRTUAL_DEVICE_NAME