Flutter failing to connect to emulator with VSCode

╄→尐↘猪︶ㄣ 提交于 2019-12-22 10:54:40

问题


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 VSCode to fix the issue as well as setting environment variables.

This is the error that I get when launching debug mode. Failed to launch emulator: Error: Emulator didn't connected within 60 seconds

Are there any better emulators that I can use for both android and IOS, because I don't even know where to begin with IOS emulators. I'm new to app development and want to get started making applications for both devices.


回答1:


Steps:

  1. Open Android Studio
  2. Tools -> AVD Manager
  3. Virtual Device -> Actions (Refer Image)
  4. Click On Stop
  5. Now Start Emulator

Now it's working fine :)




回答2:


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.




回答3:


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.



来源:https://stackoverflow.com/questions/55677874/flutter-failing-to-connect-to-emulator-with-vscode

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!