4

我使用的是帶有Intel 2117U處理器和6GB內存的Acer Aspire E1-530。Android Emulator在Ubuntu 16.10上無法正常工作

我按照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 
+0

你有獨立顯卡嗎? –

回答

11

更換模擬器的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++/ 
+1

對此答案的任何澄清? –

2

從終端運行仿真器

$ emulator -use-system-libs -avd YOUR_VIRTUAL_DEVICE_NAME

+0

太好了。這在我的Ubuntu中正常工作 – Pal