2

I used a few Linux distros (Ubuntu, Deepin, etc.) and I'm using KDE Neon User Edition at the moment. When I want to use Android emulator, I can't. Because Android emulator isn't run on all Linux distros for me. Info: My outputs:

user@username-PC:~/Android/Sdk/tools$ ./emulator -accel-check
accel:
0
KVM (version 12) is installed and usable.
accel
user@username-PC:~/Android/Sdk/tools$ kvm-ok 
INFO: /dev/kvm exists
KVM acceleration can be used
user@username-PC:~/Android/Sdk/tools$ egrep -c '(vmx|svm)' /proc/cpuinfo
4

When I start the Android emulator, I get this error:

emulator: WARNING: Not all modern X86 virtualization features supported, which introduces problems with slowdown when running Android on multicore vCPUs. Setting AVD to run with 1 vCPU core only.
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)
  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:  58
  Current serial number in output stream:  59

When I set Multi-core CPU setting as 1:

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)
  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:  58
  Current serial number in output stream:  59

When I change Graphics setting as Software - GLES 2.0 (default: Automatic), I get this: enter image description here

1 Answer 1

0

Using system libstdc++ solves the issue

For example:

cd ~/Android/Sdk/tools
./emulator -avd Nexus_5X_API_27 -use-system-libs

If it works correctly, set the following variable in ~/.bashrc:

export ANDROID_EMULATOR_USE_SYSTEM_LIBS=1

Re-login or source ~.bashrc. You can then omit the -use-system-libs option:

./emulator -avd Nexus_5X_API_27

This method does not work when the emulator is called from Android Studio. Here is a workaround

Create a shell script android-studio.sh in a directory available in your PATH. For example ~/bin with the following contents:

#!/bin/bash
export ANDROID_EMULATOR_USE_SYSTEM_LIBS=1
~/Programs/android-studio/bin/studio.sh %f

and then update the launcher command in

~/.local/share/applications/jetbrains-studio.desktop

to point to ~/bin/android-studio.sh.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .