Cannot launch emulator on Linux (Ubuntu 15.10)

2019-01-03 21:24发布

I try to launch emulator but it outputs into log:

libGL error: unable to load driver: r600_dri.so 
libGL error: driver pointer missing 
libGL error: failed to load driver: r600 
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: r600_dri.so 
libGL error: driver pointer missing 
libGL error: failed to load driver: r600 
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: r600_dri.so 
libGL error: driver pointer missing 
libGL error: failed to load driver: r600
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: Increasing RAM size to 1GB

How to fix it? I read topics with similar errors but it doesn't help me.

13条回答
我命由我不由天
2楼-- · 2019-01-03 21:29

This is fixed in Android Emulator 27.2.9. See the first fix listed here: https://developer.android.com/studio/releases/emulator#fixes

查看更多
在下西门庆
3楼-- · 2019-01-03 21:32

I have a similar error in Ubuntu 16.04 64-bit. For me the answer #23 solution works great https://code.google.com/p/android/issues/detail?can=2&start=0&num=100&q=&colspec=ID%20Status%20Priority%20Owner%20Summary%20Stars%20Reporter%20Opened&groupby=&sort=&id=197254

$ 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++
查看更多
ゆ 、 Hurt°
4楼-- · 2019-01-03 21:40

i do this and it's working

cd ~/Android/Sdk/emulator/lib64/libstdc++ 
mv libstdc++.so.6 libstdc++.so.6.bak
ln -s /usr/lib/x86_64-linux-gnu/libstdc++.so.6 libstdc++.so.6
查看更多
欢心
5楼-- · 2019-01-03 21:40

Try to change graphics option in Emulator settings: enter image description here

查看更多
姐就是有狂的资本
6楼-- · 2019-01-03 21:41

Take a look at

https://code.google.com/p/android/issues/detail?id=197254

in particular items #3 and #19. This is a workaround rather than a true solution, but it got me moving again. You will have to adjust the command for:

  • the location of the libstdc++.so.6 file on your system - I used locate libstdc++.so.6 to find this
  • the path to the emulator executable
  • the name of your emulator

so my command was

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

This then launches the emulator, and you can select it in the 'Device Chooser' dialogue when you run your app.

查看更多
太酷不给撩
7楼-- · 2019-01-03 21:41

Using the libstdc++.so.6 that is available in your system instead of the one bundled with the android sdk solves this issue.

  • The emulator has a switch -use-system-libs to do this.

    ~/Android/Sdk/tools/emulator -avd Nexus_5_API_23 -use-system-libs

  • Alternatively you can set the ANDROID_EMULATOR_USE_SYSTEM_LIBS environment variable to 1 for your user/system. This has the benefit of making sure that the emulator will work even if you launched it from within Android Studio.

More details: https://code.google.com/p/android/issues/detail?id=197254#c15

查看更多
登录 后发表回答