Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mac OS Big sur Flutter install error, “Bad state: Future already completed”

it's showing like this.

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:678:23)
#2      _NativeSocket.issueWriteEvent.issue (dart:io-patch/socket_patch.dart:1043:14)
#3      _NativeSocket.issueWriteEvent (dart:io-patch/socket_patch.dart:1050:12)
#4      _NativeSocket.multiplex (dart:io-patch/socket_patch.dart:1071:11)
#5      _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:168:12)
Error: Unable to 'pub upgrade' flutter tool. Retrying in five seconds...

I totally uninstall flutter from macOS Big Sur. but it's still showing the same result.

like image 629
mihirpipermitwala Avatar asked Nov 18 '20 20:11

mihirpipermitwala


2 Answers

It looks like the issue is related to antivirus software.

I tried installing from zip but continued running into the exact same issue with any Flutter commands. I had to temporarily disable Avast Security and everything resolved itself.

Link to issue on GitHub.

Update
Disabling the "Scan Secure Connection" option on the Web Shield lets me keep Avast running without any issue with Flutter.

like image 82
Owen Avatar answered Oct 05 '22 05:10

Owen


I use Avast Security and had to switch off both File Shield and Web Shield in order to "flutter upgrade" and "flutter pub get" on my project.

Switch off these Core Shields if using Avast Security

I imagine will need to do the same to add new dependencies and possibly while building for web which is definitely a pain.

like image 22
HEP Avatar answered Oct 05 '22 05:10

HEP