How to have both waydroid and android studio emulator?

Once I enable waydroid, android studio emulator will not start - it will complain “not enough memory to run haxm”. I tried to stop waydroid and lxd service but the problem remain. I can only run the emulator again after disabling waydroid in my nixos config and reboot.

Is there any way to have both?

Well, how much memory do you have?
How much is used before starting the emulator when it works vs. not?
Have you tried reducing the emulator’s available system memory?

I believe that error message is kind of misleading because actually it means emulator can’t use kvm so it fall back to haxm which is only relevant in Macos or Windows - or at least that’s someone says android - HAXM not working on Linux - Stack Overflow

Is virtualisation enabled in your UEFI?

Sorry I didn’t make it clear enough. Yes, emulator works normally except when I enable waydroid

Does KVM work in general with waydroid enabled, i.e. via qemu-kvm or libvirt?

not really related to waydroid, but i was getting similar error,

turned out it was because I had

systemd.enableUnifiedCgroupHierarchy = false;

removing that made possible to run emulator again