Dart-code: Error: Emulator didn't connect within 60 seconds

Created on 6 Sep 2020  Â·  7Comments  Â·  Source: Dart-Code/Dart-Code

When I am trying to launch an Android emulator through the VS Code, I am receiving the following error:

"Failed to launch flutter emulator: Error: Emulator didn't connect within 60 seconds".

Below is the output for "flutter doctor -v" command outside of the VS Code:

[✓] Flutter (Channel stable, 1.20.3, on Mac OS X 10.15.6 19G2021, locale en-US)
• Flutter version 1.20.3 at /Users/mais.gurbanov/Flutter
• Framework revision 216dee60c0 (5 days ago), 2020-09-01 12:24:47 -0700
• Engine revision d1bc06f032
• Dart version 2.9.2

[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
• Android SDK at /Users/mais.gurbanov/Android/sdk
• Platform android-28, build-tools 28.0.3
• ANDROID_HOME = /Users/mais.gurbanov/Android/sdk
• Java binary at:
/Library/Java/JavaVirtualMachines/jdk1.8.0_261.jdk/Contents/Home/bin/java
• Java version Java(TM) SE Runtime Environment (build 1.8.0_261-b12)
• All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 11.7)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 11.7, Build version 11E801a
• CocoaPods version 1.9.3

[!] Android Studio (not installed)
• Android Studio not found; download from
https://developer.android.com/studio/index.html
(or visit https://flutter.dev/docs/get-started/install/macos#android-setup
for detailed instructions).

[✓] VS Code (version 1.48.2)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.14.0

[!] Connected device
! No devices available

"Flutter: Run Flutter Doctor" command's output inside of the VS Code:

[✓] Flutter (Channel stable, 1.20.3, on Mac OS X 10.15.6 19G2021, locale en-US)
• Flutter version 1.20.3 at /Users/mais.gurbanov/Flutter
• Framework revision 216dee60c0 (5 days ago), 2020-09-01 12:24:47 -0700
• Engine revision d1bc06f032
• Dart version 2.9.2

[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
• Android SDK at /Users/mais.gurbanov/Android/sdk
• Platform android-28, build-tools 28.0.3
• Java binary at: /Library/Java/JavaVirtualMachines/jdk1.8.0_261.jdk/Contents/Home/bin/java
• Java version Java(TM) SE Runtime Environment (build 1.8.0_261-b12)
• All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 11.7)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 11.7, Build version 11E801a
• CocoaPods version 1.9.3

[!] Android Studio (not installed)
• Android Studio not found; download from https://developer.android.com/studio/index.html
(or visit https://flutter.dev/docs/get-started/install/macos#android-setup for detailed instructions).

[✓] VS Code (version 1.48.2)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.14.0

[!] Connected device
! No devices available

I can launch an emulator through the terminal by executing the "emulator -avd flutter_emulator" command and it launches successfully. Then VS Code also detects that emulator and displays it in the devices bar at the bottom part.

awaiting info stale

Most helpful comment

You can try to wipe the data of the particular device.

Go to -> Android Studio -> Tools -> AVD Manager -> [Select the down triangle on your chosen device] -> Wipe data.

Now retry.

All 7 comments

same here, but for iOS - don't really care for Android.

My error in VSCode Debug Console looks like:
Exception attempting to connect to the VM Service: SocketException: OS Error: Connection refused, errno = 61, address = 127.0.0.1, port = 58050

flutter doctor -v output (outside VSCode):
[✓] Flutter (Channel stable, 1.20.2, on Mac OS X 10.15.6 19G2021, locale en-US)
• Flutter version 1.20.2 at /Users/lesleychang/flutter
• Framework revision bbfbf1770c (3 weeks ago), 2020-08-13 08:33:09 -0700
• Engine revision 9d5b21729f
• Dart version 2.9.1

[✗] Android toolchain - develop for Android devices
✗ Unable to locate Android SDK.
Install Android Studio from:
https://developer.android.com/studio/index.html
On first launch it will assist you in installing the Android SDK
components.
(or visit https://flutter.dev/docs/get-started/install/macos#android-setup
for detailed instructions).
If the Android SDK has been installed to a custom location, set
ANDROID_SDK_ROOT to that location.
You may also want to add it to your PATH environment variable.

[✓] Xcode - develop for iOS and macOS (Xcode 11.7)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 11.7, Build version 11E801a
• CocoaPods version 1.9.3

[!] Android Studio (not installed)
• Android Studio not found; download from
https://developer.android.com/studio/index.html
(or visit https://flutter.dev/docs/get-started/install/macos#android-setup
for detailed instructions).

[✓] Connected device (1 available)
• iPhone SE (2nd generation) (mobile) • A541E5E1-2779-43BF-B517-C57732240F6D
• ios • com.apple.CoreSimulator.SimRuntime.iOS-13-7 (simulator)

My emulator works - doesn't matter what device I use (saying this b/c someone mentioned using iPhone SE is relevant b/c it's not new enough?).

I've made sure to:

  • [x] add Google-Service.plist by right-clicking Runner and Add Files... in the ios/Runner XCode workspace
  • [x] uncommenting platform number 13.0 in Podfile
  • [x] running pod repo update
  • [x] losing my mind w/ a bunch of other attempts i'll try to remember everything i've tried...

@MaisGurbanov when you launch the emulator from VS Code and get this message, do you see the emulator launch and appear? If so, does it show up in flutter devices once it is loaded? (The output of flutter doctor you posted says no connected devices, but it's not clear if you ran it after launching the emulator). Could you try capturing a log using the Dart: Capture Logs command (you can untick Analysis Server, but leave everything else ticked).

@rasreee this seems like a different problem with a different message, could you file a separate issue and also include a log captured with the above command? Thanks!

This issue has been marked stale because it is tagged awaiting-info for 30 days with no activity. Remove the stale label or comment to prevent the issue being closed in 10 days.

You can try to wipe the data of the particular device.

Go to -> Android Studio -> Tools -> AVD Manager -> [Select the down triangle on your chosen device] -> Wipe data.

Now retry.

You can try to wipe the data of the particular device.

Go to -> Android Studio -> Tools -> AVD Manager -> [Select the down triangle on your chosen device] -> Wipe data.

Now retry.

This one works well for me

You can try to wipe the data of the particular device.

Go to -> Android Studio -> Tools -> AVD Manager -> [Select the down triangle on your chosen device] -> Wipe data.

Now retry.

It worked for me too, thank you.

You can try to wipe the data of the particular device.

Go to -> Android Studio -> Tools -> AVD Manager -> [Select the down triangle on your chosen device] -> Wipe data.

Now retry.

This does works but it keeps happening often. Any permanent fix on this?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lukepighetti picture lukepighetti  Â·  4Comments

DanTup picture DanTup  Â·  4Comments

e200 picture e200  Â·  3Comments

FeimiSzy picture FeimiSzy  Â·  4Comments

DanTup picture DanTup  Â·  3Comments