0

I have installed Flutter, Android Studio and VSCode. I am trying to use Android Studio's emulator as emulator in VSCode but there are problems. Yesterday, the counter increased 2 minutes after each press of the button in the counter application. So computer got slower. I turned the computer off and on and today, in the emulator, there is only "android" text on the black screen and the counter application does not open. (First I typed Flutter:Launch Emulator to the bar opened with ctrl+shift+p, then I pressed "start debugging" from the run menu.)

Debug Console message is:

Launching lib\main.dart on Chrome in debug mode...
lib\main.dart:1
Failed to bind web development server:
SocketException: Failed to create server socket (OS Error: Failed to start accept), address = 
localhost, port = 63872
Exited (sigterm)

My laptop is 2012 model, windows7, intel core i5 2.5ghz, 6gb ram and despite everything, I want to make apps with Flutter.

Aycan Candar
  • 63
  • 1
  • 9
  • The debug console output says that you are trying to run the application in chrome (web). But, what you are trying to run the application is in android emulator. – immadisairaj Jan 15 '22 at 15:15
  • I guess I have to select it after pressing start debugging but when I press it there is no option – Aycan Candar Jan 15 '22 at 15:18
  • I hope you have "flutter" extension installed in VSCode. You will be able to select device from the bottom right and run the application when in "main.dart". – immadisairaj Jan 15 '22 at 15:22
  • There is an answer I found which you could use to improve the performance of emulator. Link - https://stackoverflow.com/a/10233115/10136829 – immadisairaj Jan 15 '22 at 15:23
  • I am using VSCode for the first time. I did what you said but this time I got this error "Failed to launch Nexus 5X API 24: Error: Emulator didn't connect within 60 seconds" – Aycan Candar Jan 15 '22 at 15:28
  • 1
    I'll check the link, thanks. – Aycan Candar Jan 15 '22 at 15:29
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/241087/discussion-between-immadisairaj-and-aycan-candar). – immadisairaj Jan 15 '22 at 15:50

1 Answers1

0

Ideally you should have at least 8GB of RAM and a SSD hard drive on your laptop. VSCode (and I think most, if not all, IDEs) and the Android Emulator consume a decent amount RAM separately, let alone concurrently.

I think Windows 7 should be fine.

Upgrading your hardware isn't always ideal (or cost effective) so in order to work with what you have, I have two suggestions.

First, check for any updates, either for VSCode, emulator, Flutter, Android Studio etc. Make sure all elements of software are updated to a stable version. Also check to make sure there aren't version conflicts between them.

Second, try using an Android device rather than the emulator. This way your RAM can allocate more power for VSCode rather than be further burned with the emulator.

Third, if you don't have access to an Android device, you can try to configure your emulator acceleration. Try experimenting with the different modes and see if a higher accelerator is better or a lower one, although I'm assuming if you try to use a higher one you'll run into issues as it might consume more RAM.

This question is a bit dated but it could still provide some insight. You could also experiment with other Android Emulators to see if one works faster and consumes less RAM.

This is a bit of a stretch but I think you could also try to change the device on the emulator being used. Maybe an older device with an older Android version might not consume as much RAM or require as much processing power. I'm merely speculating here but I figured it's worth a shot.

Personally, I have not tried any other emulators and pretty much always use an Android Device instead of the emulator. I think you're best bet, aside from upgrading your hardware, would be to get your hands on an android device. If you can't, then try the other options I mentioned (accelerator configuration, different device/OS version for emulator, other emulators etc.).

Matt Croak
  • 2,788
  • 2
  • 17
  • 35