Unable to debug using VSCode for flutter. I\'m using windows and I\'m trying to use a android emulator.
I have attempted to reinstall flutter, android SDK and VSCod
Steps:
Now it's working fine :)
Approach of wiping data listed above worked for me , i mentioned those in steps :- Steps:
1.Open Android Studio 2.Tools -> AVD Manager 3.Virtual Device -> Actions 4.Click On wipe data 5.Now Start Emulator 6.Now restart the pc
Restarting the pc is not necessary i just did it as a follow-up, although make sure your android studio is updated because in my case AS was not updated so i think my emulator was not working and VS Code was throwing errors .
Try restarting your PC once! It worked for me!
I am using Genymotion 3.0.2., VS Code (version 1.36.1)
You can read about it here - Using Genymotion Emulator with Flutter in VS Code — (Without Android Studio)
Open up Genymotion and go to the ADB Setting section:
Notice how the default selection is “Use Genymotion Android Tools (default)”? With this selection, the emulator is not recognized.
Change it to “Use custom Android SDK tools”, set the SDK location to where your SDK is (in my case it’s at “C:\Program Files (x86)\Android\android-sdk”). Make sure the tick mark (“This folder is valid”) is displayed.
Close the settings box. Now reload your “VS Code” IDE.
Mine was similar but for iOS and it said Failed to launch iOS Simulator: Error: Emulator didn't connect within 60 seconds
. I closed all instances of VS Code, opened the project again and this time it worked.
For android emulator there are alternatives like geanny motion.
Since you have AVD installed you could try running from the command line.
run flutter devices
to get the list of emulators and their id.
then run (assuming emulator-5554 is you emulator id) flutter run -v -d emulator-5554
Finally you the option of starting android studio then start your emulator,form the IDE and the run the above command or you even run the app from the IDE.