macOS Big Sur: Flutter doctor error – Bad state: Future already completed

If you are running into issues getting Flutter setup for development on macOS Big Sur and you are getting the following error when running the ‘flutter doctor’ command and you have Avast Antivirus running, there is a good chance Avast is your problem.

Error Message:

❯ flutter doctor -v
[✓] Flutter (Channel stable, 1.22.4, on macOS 11.0.1 20B29 darwin-x64, locale en-US)
    • Flutter version 1.22.4 at /Users/<user>/dev/env/flutter
    • Framework revision 1aafb3a8b9 (4 days ago), 2020-11-13 09:59:28 -0800
    • Engine revision 2c956a31c0
    • Dart version 2.10.4

⣽Unhandled 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      _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:168:12)

Once I uninstalled Avast, the ‘flutter doctor’ command works without issue.

Published by

Tim Clark

Experienced Business Owner, Chief Information Officer, Vice President, Chief Software Architect, Application Architect, Project Manager, Software Developer, Senior Web Developer, Graphic Designer & 3D Modeler, University Instructor, University Program Chair, Academic Director. Specialties: Ruby, Ruby on Rails, JavaScript, JQuery, AJAX, Node.js, React.js, Angular.js, MySQL, PostgreSQL, MongoDB, SQL Server, Responsive Design, HTML5, XHTML, CSS3, C#,, Project Management, System Design/Architecture, Web Design, Web Development, Adobe CS6 (Photoshop, Illustrator)

One thought on “macOS Big Sur: Flutter doctor error – Bad state: Future already completed

  1. Thanks Tim – this helped. Same thing occurs with ‘Kasperky Internet Security’ running on Big Sur. But fortunately I can just quit Kaspersky for Flutter doctor to work properly vs completely uninstalling Kaspersky.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s