I have recently upgraded my flutter version in my app. But when I want to debug the application, it shows me the following error.
Error connecting to the service protocol: HttpException: Connection closed before full header was received, URI = http://127.0.0.1:50795/ws
Is there anyone facing the same issue after upgrading the flutter version? If is there any workaround, please share.
My solution to fix this issue is we can use FadeInImage to know when is the request image got the error Connection closed before full header was received, URI = we can handle it on imageErrorBuilder method.
The secure connection ends before the content of http response doesn't come back. Http Parser will report the exception "connection closed before full header was received". I did a comparison between the dart and curl.
It may be because the widget is reused in the widget tree and thus interrupts the HTTP request. You could then use a key in your FutureBuilder or Image widget. child: FutureBuilder<File> ( key: ValueKey (imageUrl), // or use UniqueKey () ... Show activity on this post.
Right now this issue is opened on github https://github.com/flutter/flutter/issues/32587
Temporarily you can solve this issue by switching to physical device instead of emulator How to test android apps in a real device with Android Studio?
Decision found on github (link upward)
I've got a temporary work around, which I can use for now. The exception above is thrown when I run the emulator as a Pixel 3 Android 9.+ Target (Q API). I made up a second emulated device, a Pixel 2 Android 9.0 Target (28 API), and this target works fine.
I'm also noticing that the Pixel 2 target takes up 8.5GB on Disk, while the Pixel 3 target only takes up 1.4GB. It makes me wonder if the Pixel 3 target is missing some important things.
The issue is mainly with Android Q
.
You can downgrade your android version from Android Q
to Android Pie
.
which eventually leads to resolve the issue.
No solution unless the Flutter guys fix it.
I'm having it on one machine (Mac OS Mojave) even when connecting physical iOS devices. Of course it happens too with emulated Android devices (no matter which one).
I've also having this problem in a different computer (MacOS Mojave too) with a physical Android device (with a very old Android version: 5.1).
flutter clean
does not fix it at all in my case(s).
First turning off your WiFi/Bluetooth.
And run below command:
flutter clean
And then quitting or restarting your emulator.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With