-
Notifications
You must be signed in to change notification settings - Fork 26.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
iOS Device - Error connecting to the service protocol: HttpException: Connection closed before full header was received, uri = http://127.0.0.1:1024/7El8EVb7r60=/ws #32651
Comments
Just to note: This issue wasn't happening a few months ago, then it started to happen randomly and now it is a constant, making it impossible to debug on an iOS device. |
Some more info: When I run from command line "flutter run", I get this error: Error connecting to the service protocol: HttpException: , uri = And the app is running on the device - I can see the main screen. When I run from VS Code - F5 or ctrl-F5, I get a white screen with the same error: Error connecting to the service protocol: HttpException: , uri = http://127.0.0.1:1024/bLcFaTaqJBQ=/ws Before, when I didn't had this error permanently, just randomly, I saw that the port number was auto-incrementing (1023, 1024, 1025, ...) to find a port that wasn't blocked or being used. I believe that this can be solved changing the port number, but I don't have any idea or skills to reprogram a port change on flutter. |
On android studio, the app launches but I have this on the Console: Launching lib/main.dart on iPhone Mauro in debug mode... |
Finally got it to work. Steps I made:
The real issue is that I have to find the PID and kill it everytime I stop the app. |
Here is a short command that finds the PID and kills the process using the port 1024:
|
I had this running Q. Changing to Pie helped |
I am using iPhone. |
I was opened 12 days ago and no review from the Flutter team. What is the strategy here, wait and let it die by itself? |
I'm getting the same error. I'm not sure, but can it be related with CocoaPods version? Mine is also 1.7.0 |
The same problem but how do you use your iPhone. Because my android sim is not working. |
@knissophiliac Usually, killing the process that is using the 1024 port with the line from my previous comment, it works. If not I disconnect/reconnect the iPhone and keep killing the port (if it is being used) and then it works. |
@c0h1b4 I change my CocaPods version to 1.5.0. I'm getting this error rarely. If I get it, I unplug my device and replug it. That's a temporary solution but it works for me :) |
Not working for me :( And no help from Flutter team. |
Still waiting for some help of the Flutter team. |
@c0h1b4 am I understanding this correctly?
If so, does this repro from the command line (with WiFi debugging disabled)? If so, could you capture a full verbose log (using If it doesn't happen at the terminal (only VS Code) and you have IntelliJ or Android Studio available, could you see if the issue reproduces there? |
Let me clear the questions:
lsof -n -i4TCP:1024 lsof -n -i4TCP:1024 Now, I need to stop the app on the iOS device (iPhone) to exit the splash screen, and kill the process that is blocking 1024 port, unplug/plug de iOS device and run again (F5). Now everything works, hot reload, devTools, restart (shift-cmd-F5). BUT, if I stop the app (shift-F5 or stop button), after the app stops on the device and shows on the VS Code that it is stopped I see that mobiledev is still holding the port: If I try run again, I get the "Error connecting to the service protocol: HttpException: Connection closed before full header was received, uri = http://127.0.0.1:1024/is-7bqXvKkI=/ws" error with the splash screen frozen. The only way to run without unplugging/plugging the device is to kill the process before running the app. Also, if there is any other device (Android) connected to the computer, it will never work, al
WiFi debug is disabled. Gist with the port 1024 being used by mobiledev: https://gist.github.com/c0h1b4/684a678e411a56ae20208f80a4a26930 Gist with the mobiledev process killed before running: On Android Studio I was having the same issues, but today to check your questions, I just saw that I don't have this issue after I stop the app. So it looks like the issue is only with the VS Code. I will do a test after rebooting the computer to see if the issue appears on Android Studio on the first run and post here in a few minutes. Also, here is my flutter doctor -v: [✓] Flutter (Channel dev, v1.7.9, on Mac OS X 10.14.5 18F132, locale en-BR) [✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3) [✓] Xcode - develop for iOS and macOS (Xcode 10.2.1) [✓] iOS tools - develop for iOS devices [✓] Chrome - develop for the web [✓] Android Studio (version 3.4) [✓] VS Code (version 1.35.1) [✓] Connected device (3 available) • No issues found! |
Just checked on Android Studio after reboot and with 2 Android devices connected and the issue is gone on Android Studio. It seems to be isolated to VS Code and terminal 'flutter run' only, by now. |
After the successful test on Android Studio, I stopped the app on Android Studio, quit Android Studio, checked the 1024 port (it is clean), started VS Code and run the app: Stuck on splash screen. Launching lib/main.dart on iPhone Mauro in debug mode... lsof -n -i4TCP:1024 COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME |
Thanks for the info - I was thinking that VS Code might be terminating Flutter in a way that it's not cleaning up properly, but that doesn't explain why it wouldn't work the very first time or why it happens from the terminal. I don't have an iPhone unfortunately to test here (and if I understand correctly, it only happens with a physical iOS device?). I'm curious about the mobiledev process - do you know where that's from? Is it part of our one Flutter's dependencies or part of the iOS toolchain (I can't find anything online)? |
Can you get a tree of process that includes |
Ok, I got your advice and followed the white rabbit on "mobiledev". It looks like it is installed by homebrew on the Mac. I will try uninstalling it and check if Flutter still works. And the mobiledev process does not show up before F5. |
Ok, after uninstalling mobiledevice, flutter stopped to work. So it is an essential part of it. before stop (vs code): after stop (vs code): COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME So I believe that the cleanup after stopping on VS Code must be missing something. |
@c0h1b4 thanks, this helps! Could you capture a verbose log from VS Code?
When logs are being captured, it'll run Flutter in verbose mode (same as If you can repro this from the terminal, the same log running |
@DanTup Running the project with F5: Running the project from terminal: On both actions, I get the mobiledev process stuck on port 1024 after stopping the app. PS: I killed the 1024 port process before running. |
@c0h1b4 thanks! There's something a little weird in those logs - looks like we tell the app to stop twice, and the first one doesn't get a response. I don't know if that's contributing to the issue, but it feels wrong. I can repro that locally so I'll have a go at fixing and then you can test if it makes any difference. |
@c0h1b4 could you see if this build makes any difference? https://github.com/Dart-Code/Dart-Code/releases/tag/v3.3.0-alpha.2 Download the We were previously sending Be aware that clicking the Stop button a second time during shutdown will perform a |
I'm facing the same problem. This is my flutter doctor /Users/antoninobajeli/Documents/FlutterSDK/flutter/bin/flutter doctor --verbose [✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3) [✓] iOS toolchain - develop for iOS devices (Xcode 10.2.1) [✓] Android Studio (version 3.4) [✓] IntelliJ IDEA Community Edition (version 2017.2.6) [✓] Connected device (2 available) • No issues found! |
@antoninobajeli I posted a build of the VS Code extension above with some tweaks but haven't had any feedback. There's a newer version at https://github.com/Dart-Code/Dart-Code/releases/tag/v3.3.0-beta.2 now. I'm still interested to hear if it improves things for anyone (or even if it makes things worse). |
Hello. On the latest version the issue is solved! |
@c0h1b4 excellent! Thanks for confirming. I'll close this, but if anyone comes here with similar issues - please try the latest v3.3 build from https://github.com/Dart-Code/Dart-Code/releases and if you still see issues, open a new issue with a log attached. |
@ride4sun sorry for the delay in responding - looks like the issue was tracked down and resolved in your other issue though :-) FWIW, v3.3 was the VS Code extension and you likely already have much newer than that now (since that was some time ago) so there would be no need to switch to that version. |
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of |
Steps to Reproduce
Error connecting to the service protocol: HttpException: Connection closed before full header was received, uri = http://127.0.0.1:1024/kzLI1UZIOJQ=/ws
I read all the issues here (duplicates and non duplicates) and all the solutions are worthless for my case.
What I have tried:
So, I am running out of ideas. I need to have iOS device access on development because I am developing an app that uses camera to take photos and qr-code reader. It is very frustrating to have this kind of issues on a such great tool. From what I saw in the web, this is a MAJOR BREAKING issue that happens on some people but not to others. I hope the Flutter team fixes this on the next version.
On IOS Simulator, it works perfectly.
On Android Simulator, it works perfectly.
On Android Device, it works perfectly.
Logs
debug console:
Launching lib/main.dart on iPhone Mauro in debug mode...
Signing iOS app for device deployment using developer identity: "iPhone Developer: ..."
Xcode build done. 3.5s
Error connecting to the service protocol: HttpException: Connection closed before full header was received, uri = http://127.0.0.1:1024/kzLI1UZIOJQ=/ws
Exited (sigterm)
flutter doctor -v
[✓] Flutter (Channel dev, v1.5.8, on Mac OS X 10.14.4 18E226, locale en-BR)
• Flutter version 1.5.8 at /Users/mauro/development/flutter
• Framework revision 0ba6722 (3 weeks ago), 2019-04-24 17:18:28 -0700
• Engine revision c63d1cf
• Dart version 2.3.0 (build 2.3.0-dev.0.1 1f1592edce)
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
• Android SDK at /Users/mauro/Library/Android/sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-28, build-tools 28.0.3
• ANDROID_HOME = /Users/mauro/Library/Android/sdk
• ANDROID_SDK_ROOT = /Users/mauro/Library/Android/sdk
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01)
• All Android licenses accepted.
[✓] iOS toolchain - develop for iOS devices (Xcode 10.2.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 10.2.1, Build version 10E1001
• ios-deploy 1.9.4
• CocoaPods version 1.7.0.beta.1
[✓] Android Studio (version 3.4)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 35.3.1
• Dart plugin version 183.6270
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01)
[✓] VS Code (version 1.33.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.0.2
[✓] Connected device (1 available)
• iPhone Mauro • e1216cebac409d83bc8d37bde15f8af53564c933 • ios • iOS 12.3
• No issues found!
The text was updated successfully, but these errors were encountered: