Hello,
I am running nixos-unstable NixOS 20.03pre194293.2436c275
.
When trying to launch an emulator from Android Studio, I get the following error:
Emulator: /home/julius/Android/Sdk/emulator/qemu/linux-x86_64/qemu-system-x86_64:
error while loading shared libraries: libnss3.so: cannot open shared object file: No such file or directory
Emulator: Process finished with exit code 127
I have tried running Pixel 3 API 29 and Nexus 5X API 28, both produce the same error.
I have also tried running an emulator with emulateApp
(app
attribute is set to the apk file built by Android Studio):
with import <nixpkgs> {
config = {
android_sdk.accept_license = true;
};
};
androidenv.emulateApp {
name = "PolarView";
platformVersion = "28";
abiVersion = "x86_64";
systemImageType = "default";
app = app/build/outputs/apk/debug/app-debug.apk;
package = "com.github.jul1u5.polarview";
activity = ".MainActivity";
}
After getting a dated looking emulator by executing result/bin/run-test-emulator
I get this error:
adb: failed to install /nix/store/323pqyjip2k4ipz3bxyz9884wz1vbw2l-app-debug.apk:
Failure [INSTALL_FAILED_TEST_ONLY: installPackageLI]
The emulator also has an enormous unnecessary keyboard on the right side, and I can’t find how to get rid of it.
I have also tried using buildApp
for the app
attribute however, the derivation fails to build because:
Buildfile: build.xml does not exist!
Build failed
I have no idea what build.xml
is, and where it should come from (Android Studio doesn’t create this file).
I would appreciate if someone could explain any of my questions:
- Why I can’t run emulators from Android Studio and how can I fix this?
- How can I get
emulateApp
andbuildApp
functions to work? - How can I update or modify (disable the onscreen keyboard) the emulator that is produced by
emulateApp
?