Running an "Example" app that's inside a package project, via VSCODE

377 views
Skip to first unread message

Jeff Jorczak

unread,
Aug 17, 2018, 4:52:36 PM8/17/18
to Flutter Dev
I have a Flutter package with a Flutter example project inside it, structured like so:

package
 
|- example
   
|- lib
     
|- main.dart

I set up the launch.json like so:

        {
           
"name": "Flutter",
           
"request": "launch",
           
"type": "dart",
           
"program": "example/lib/main.dart",
           
"flutterMode": "debug"
       
}

but I get this error when trying to run the app:

Launching example/lib/main.dart on iPhone 7 in debug mode...
No application found for TargetPlatform.ios.
Is your project missing an ios/Runner/Info.plist?
Consider running "flutter create ." to create one.
Exited (sigterm)

How might I get it to look at "example" as the project root when running instead of "package"?

Danny Tuppeny

unread,
Aug 18, 2018, 4:46:51 PM8/18/18
to Flutter Dev
Looks like you have found a bug in the handling of relative paths in program! I've opened an issue to fix in the next release but for now you can workaround this by using ${workspaceFolder} in program so that we get an absolute path.

Change:

"program": "example/lib/main.dart"

to

"program": "${workspaceFolder}/example/lib/main.dart"

This should result in the example folder being used as the working directory which should prevent the error you're seeing. Sorry for the bother!
Reply all
Reply to author
Forward
0 new messages