0

Strangely I can start the very same avd from android-studio - but when trying to start it from command-line I am getting this:

$ DISPLAY=":0" emulator @28
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

I only installed AS on this PC as it seems you cannot setup an AVD via CLI anymore. This should become another build-server - really not sure what is going on there. Was no problem on ubuntu - but I am trying to setup another build-server with nixos.

ligi
  • 39,001
  • 44
  • 144
  • 244

1 Answers1

0

Android-studio uses an FHSUserEnv and you probably need the same environment when starting your emulator

% nix-shell -p android-studio
[nix-shell:~/git/nixpkgs]$ which android-studio
[nix-shell:~/git/nixpkgs]$ cat /nix/store/a2vs86rhf2a9va1792i87h3pmir6y7v5-android-studio-3.1.3.0/bin/android-studio
#!/nix/store/dkh7l9a4sx7zqh8riqbj3z21sz25p8xy-bash-4.4-p23/bin/bash
/nix/store/cpiignabpci7p7dqir3bx6gs4mcghcg7-android-studio-fhs-env/bin/android-studio-fhs-env /nix/store/fnls4fjf5cd5za87l83ja9ibcqnkpy90-android-studio-3.1.3.0/bin/studio.sh
[nix-shell:~/git/nixpkgs]$ /nix/store/cpiignabpci7p7dqir3bx6gs4mcghcg7-android-studio-fhs-env/bin/android-studio-fhs-env

Also make sure opengl-driver are in LD_LIBRARY_PATH (default on nixos).

[joerg@turingmachine nixpkgs]$ echo $LD_LIBRARY_PATH
/run/opengl-driver/lib:/run/opengl-driver-32/lib:/usr/lib:/usr/lib32
[joerg@turingmachine nixpkgs]$ # try starting the emulator here
Mic92
  • 1,298
  • 15
  • 13