nativeshell icon indicating copy to clipboard operation
nativeshell copied to clipboard

The Flutter Attach to Process gets stuck on Waiting...

Open rutvik110 opened this issue 3 years ago • 3 comments

I'm trying to run the Flutter Attach to Process as said to support hot reload and hot restart. I've the examples app running but the this process is getting stuck while launching.

My launch.json file

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Flutter: Attach to Process",
            "type": "dart",
            "request": "attach",
            "osx": {
                "serviceInfoFile": "${env:TMPDIR}vmservice.nativeshell_examples",
            },
            "windows": {
                "serviceInfoFile": "${env:TEMP}/vmservice.nativeshell_examples"
            },
            "linux": {
                "serviceInfoFile": "${env:XDG_RUNTIME_DIR}/vmservice.nativeshell_examples"
            }
        },
    ]
}

You can see in the screenshot below it's waiting for connection from the application I guess Screenshot 2022-06-13 at 7 10 28 PM

I'm not sure what's happening here as I've very little knowledge about running such kind of processes but I guess it's not able to find the running application. I'm on M1 mac and running the project on Flutter 3.0.1 stable and dart 2.17.1

To reproduce the issue you can use this project I'm currently running https://github.com/rutvik110/examples

rutvik110 avatar Jun 13 '22 13:06 rutvik110

Are you using the published rust crate or current main? I think the published rust crate is outdated and does not support extracting debug URL format in Flutter 3 from stdout.

knopp avatar Jun 13 '22 14:06 knopp

Sry, didn't got you. If you mean the nativeshell package published on pub.dev, then yes.

rutvik110 avatar Jun 13 '22 15:06 rutvik110

Hey @knopp ! So, I had a look at this today again and was able to fix the issue. First of all, I'm pointing to the package on the main instead of the published one on pub.dev as you said.

  nativeshell:
   git:
     url : https://github.com/nativeshell/nativeshell.git
     path : nativeshell_dart

Though, the issue wasn't resolved after that. For some reason, it wasn't able to locate the VM instance through the following configs Screenshot 2022-06-27 at 5 14 01 PM .

I had to remove this configs and provide the vmServiceUri that you get once the application launches to get the hot reload and restart working. Screenshot 2022-06-27 at 5 15 13 PM

It works as expected after doing this updares.

rutvik110 avatar Jun 27 '22 11:06 rutvik110