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
Error connecting to the service protocol: failed to connect. #78
Comments
is the URL same as the URL printed when you run the app (cargo run)? |
Oh it's not the same. The port is different |
Which flutter version are you using? There was a regression recently in flutter tool debug attach caused by NNBD migration, but that should be resolved in latest master. |
I'm on Flutter 2.6.0-1.0.pre.108 from 2 days ago. |
I've also noticed that the last three digits of the port change randomly every time I try to attach vscode. The vmservice file contains the exact same url that Nativeshell writes, but for some reason, flutter uses a different one. |
I should also mention that this behavior isn't specific to my project. All nativeshell apps, including the example project, don't work. Normal flutter apps do. |
So flutter is trying to attach to different port than the vmservice file? That looks like a bug in flutter tool. I'll see if I can reproduce this. |
Can you try the following? In one terminal
In second
and post here the logs from flutter attach? |
Here are the logs
It suddenly started working again after doing nothing for a few hours. But the problem usually reoccurs after a while. I'll post the logs once I face it again. |
Just started facing this issue again. The logs are pretty synonymous with the previous logs. flutter attach -v -d macos --debug-url http://127.0.0.1:50445/8Yi_Kjwp5QU=/
|
The logs looks good. You can capture logs from dart-code as well ( |
Before "connecting to service protocol", it shows this:
The original port shown in the url is 50445, but Dart code is forwarding 50695 to it |
iproxy shouldn't be involved. That's when you're debugging on a device. Is the selected device in vscode (status bar option) |
Ah, that was the problem. The device changed automatically when I plugged in a new one. Setting it back to macOS fixed it. Thanks for the help! |
It should be possible to set |
Overriding the |
I think I should update the template |
I've seen this error a lot lately. Whenever I try to attach Vscode to my Nativeshell app, this error is returned:
Running a normal Flutter app works fine. Cleaning flutter and restarting my computer has no effect. It seems to randomly start and stop working.
The text was updated successfully, but these errors were encountered: