Running android emulator on nixos

I’m following the instructions here:

This is the shell.nix I’m using:

This is the error I get when I try to run the emulator in this environment:

/mnt/DATA/Android/Sdk/emulator/qemu/linux-x86_64/qemu-system-i386: error while loading shared libraries: cannot open shared object file: No such file or dire


Googling for libplds4 doesn’t give anything useful. How do I run android emulator on nixos? I installed it from AVD in android studio, which I didn’t install with nix.

I think you need to add nspr to your list.

1 Like

Yes that resolved the current issue but now I’m getting some more ‘library not found errors’. Can’t tell how many are there? I’ve added around 10 by now. Do you have a list of packages I will need to run the emulator?

This is the list of missing libraries in all binaries in emulator package directory:

Does provide a way to search which packages provide these libraries, similar to debian?

GitHub - bennofs/nix-index: Quickly locate nix packages with specific files can do that. Note that the index generation is still a little bit rough (it takes more resources than I would like).

1 Like

@bennofs Great. Btw how much ram does it consume? The nix-env instance it spawned is currently at 1.2 GB, and slowly increasing.

Also this script exists that plugs nix-index output into ldd output:

1 Like

Yeah, that’s what I meant by “more resources than I would like” :slight_smile: I haven’t measured it exactly, but I know I had troubles generating the index with less than 4G ram, while I works fine on my 8G laptop.

I don’t know who is maintaining the android package but ONLY if this is something they need to know- android needs a lot of work on NixOS, there’s a lot of trouble with licensing and libaapt2 et al.