Can't start an Android emulator using expo

I’m building an app using expo(React Native) and I’m trying to run it through the android emulator I have set the ANDROID_HOME environment varialble to the location of the SDK and I have checked that the platform-tools directory has adb in it but when I run npm start it gives me the Error: spawn /home/carl/Android/Sdk/platform-tools/adb ENOENT. Which i belive means file not found. Ive tried running it using nix-shell -p but i got the same error.

My assumption is that its trying to execute the adb binary and is unable to do so because nix doesnt allow it. Is there a workaround for this?

Anything that could point me in the right direction would be greatly appreciated!

hey! facing the same issue! have you made any progress?

Could you run lld /home/carl/Android/Sdk/platform-tools/adb and share the results?

Hey! I have the same problem and ran the command. Here’s my results:

linux-vdso.so.1 (0x00007fffc6be0000)
	libdl.so.2 => /nix/store/anlf335xlh41yjhm114swi87406mq5pw-glibc-2.38-44/lib/libdl.so.2 (0x00007f111254d000)
	libpthread.so.0 => /nix/store/anlf335xlh41yjhm114swi87406mq5pw-glibc-2.38-44/lib/libpthread.so.0 (0x00007f1112548000)
	libm.so.6 => /nix/store/anlf335xlh41yjhm114swi87406mq5pw-glibc-2.38-44/lib/libm.so.6 (0x00007f1111d20000)
	librt.so.1 => /nix/store/anlf335xlh41yjhm114swi87406mq5pw-glibc-2.38-44/lib/librt.so.1 (0x00007f1112543000)
	libgcc_s.so.1 => /nix/store/00r99fxv6l92wk0k6wd60klhs7fkmmqj-xgcc-12.3.0-libgcc/lib/libgcc_s.so.1 (0x00007f1112520000)
	libc.so.6 => /nix/store/anlf335xlh41yjhm114swi87406mq5pw-glibc-2.38-44/lib/libc.so.6 (0x00007f1111b37000)
	/lib64/ld-linux-x86-64.so.2 => /nix/store/anlf335xlh41yjhm114swi87406mq5pw-glibc-2.38-44/lib64/ld-linux-x86-64.so.2 (0x00007f1112554000)

Alright, aside from linux-vdso.so.1, check that each file inside the nix store exists.

1 Like

alright, i checked, and all files exist

Well, I am out of ideas then.

If this is some FHS-assuming dynamically linked binary, you have to execute the binary inside of an fhsenv or use a global dynamic linker such as nix-ld.

Where are you running lld from? Where are you running the build tool from?
Because you should not be getting those links unless you’re inside of an fhsenv already.