question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Bad state: Future already completed

See original GitHub issue

Describe the bug Every flutter command I try to run I get the following exception:

Bad state: Future already completed
#0      _AsyncCompleter.complete (dart:async/future_impl.dart:43:31)
#1      _NativeSocket.startConnect.<anonymous closure>.connectNext.<anonymous closure> (dart:io-patch/socket_patch.dart:682:23)
#2      _NativeSocket.issueWriteEvent.issue (dart:io-patch/socket_patch.dart:1102:14)
#3      _NativeSocket.issueWriteEvent (dart:io-patch/socket_patch.dart:1109:12)
#4      _NativeSocket.multiplex (dart:io-patch/socket_patch.dart:1130:11)
#5    …

Inside vscode if I click on run to launch the flutter project, also get the same error as this issue.

To Reproduce Steps to reproduce the behavior: Unclear, first time I have it, Installed 2 days ago, could use it 2 days in a row, while putting my pc to sleep inbetween, today after a whole day of working on other things in vscode, this happened.

Expected behavior I expect it to run without error

Screenshots image

Versions (please complete the following information):

  • VS Code version: 1.51.1
  • Dart extension version: 3.16.0
  • Dart/Flutter SDK version: 2.10.4/1.22.4
  • OSX: 11.0.1 (20B50)

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
DanTupcommented, Dec 2, 2020

Ah, glad to hear you solved it!

1reaction
DanTupcommented, Dec 1, 2020

In that case, this seems like an issue in Flutter that will need solving there, not here in the VS Code extension. It would be best raised at https://github.com/flutter/flutter/.

Before you do - if you have git it may be worth running git status inside your Flutter SDK folder, just to check you haven’t got any corrupt files (I’ve seen some people end up with badly-merged files after a Flutter upgrade). You can post the output of that here if you’re not sure how to interpret it.

Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Bad state: Future already completed · Issue #71483 - GitHub
Every flutter command I try to run I get the following exception: Bad state: Future already completed #0 _AsyncCompleter.complete (dart:async/ ...
Read more >
Future already completed in flutter listview and Video player ...
Looks like you're trying to change the state during the UI build, be sure you're not using setState(...) in ListView.builder(...).
Read more >
A network extension breaks the Flutter package manager
Bad state : Future already completed ... But the dart have closed connection already and completion handler of [NEAppProxyFlow ...
Read more >
Unhandled Exception: Bad state: Future already completed in ...
In Demo, First Screen click button go to Second screen. You do not need Navigator.pop(context); Just Navigator.pushReplacementNamed(context, '/second'); will ...
Read more >
Fix bug "Bad state: Future already completed" - Flutter
I am writing a simple flutter application, it does not have much functionality yet but one FutureBuilder component is giving me a problem...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found