Short version, I can launch an android emulator from VS Code and Android Studio, but flutter won't connect to it when I do.
I'm installing Android Studio and VS Code fresh on a new laptop, along with flutter and dart. Latest versions of all those are installed at the time I'm writing this.
I had to disable Hyper-V in Windows (but kept it enabled in the BIOS) in order to install Intel's HAXM, but it is installed.
I downloaded an Android 9 'Pie' AVD image with Google Play included, and have created a Nexus 5X device with it.
I can launch the emulated device just fine from AVD manager, but neither VS Code nor Android Studio will connect to it. I've deleted the device and recreated it, wiped its data numerous times, done plenty of laptop reboots, and nothing doing.
Launching the device from within VS Code and AS works as expected, but neither will connect to the device. In VS Code I get the 'Emulator didn't connected within 60 seconds' message, even though the emulator starts as soon as I ask it to.
I've run adb kill-server
and start-server
numerous times, no difference.
When I run adb devices
with the emulator running I get emulator-5554 unauthorized
, so maybe there's a permissions thing going on somewhere?
I'm open to suggestions. Thanks.
[Edit] subsequent testing shows that I can connect to the emulator in VS Code and Android Studio if I use an Android 9 AVD without google play, and an Android 8.1 AVD both with Google Play or without. So it's the AVD with Android 9 and Google Play that's giving heartburn, and am not sure why?