title: How do I debug a flutter app in vscode if the launch program is nested deep inside?
body: <h2>Problem in short</h2>
  
  <p>I'm trying to debug a flutter app using vscode and I get the below warning and the debugging stops due to the errors given at the end of this question. Apparently it is not able to find my dart sdk. But I have provided the sdk path in settings.</p>
  
  <pre><code>mobile_app/lib/main.dart:1: Warning: Interpreting this as package URI, 'package:mobile_app/main.dart'.
  </code></pre>
  
  <p><strong><em>The problem is mentioned in this <a href="https://medium.com/ppl-a-4-yuk-recycle/yuksharing-multi-app-structure-flutter-cb1ab547e0f2" rel="nofollow noreferrer">medium post</a> but with no solution. You might have to translate the page to read it.</em></strong></p>
  
  <p><br/></p>
  
  <h2>Further more clues</h2>
  
  <ul>
  <li>This happens only when my main program is nested more than two levels deep.I have a deeply nested folder structure (given below). The <code>main.dart</code> file is in <code>foo/code/ui/mobile_app/lib</code> and the <code>.vscode/launch.json</code> is in <code>foo</code>. I've provided this path in <code>launch.json</code> for vscode. It works fine if I place my <code>.vscode/launch.json</code> in <code>ui</code> and open the folder <code>ui</code> in vscode or when I place it under <code>mobile_app</code>.</li>
  <li>This happens only in vscode. (The other IDE I tried is Android Studio)</li>
  </ul>
  
  <p><br/></p>
  
  <h2>My folder structure</h2>
  
  <pre><code>- foo
    - .vscode
      # launch.json
    - code
      + domain (this is a dart lib (shared code))
      - ui
        - mobile_app
          - lib
            # main.dart
        + web_app
    + design
  </code></pre>
  
  <p><br/></p>
  
  <h2>launch.json</h2>
  
  <pre><code>{
      // 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": "Jamsalon Mobile App",
              "program": "code/ui/mobile_app/lib/main.dart",
              "request": "launch",
              "type": "dart"
          }
      ]
  }
  </code></pre>
  
  <p><br/></p>
  
  <h2>Complete Error</h2>
  
  <pre><code>mobile_app/lib/main.dart:1: Warning: Interpreting this as package URI, 'package:mobile_app/main.dart'.
  
  file:///C:/Users/random_user/Documents/app_development/frameworks/flutter/packages/flutter/lib/src/material/animated_icons.dart:9:8: Error: Not found: 'dart:ui'
  import 'dart:ui' as ui show Paint, Path, Canvas;
         ^
  file:///C:/Users/random_user/Documents/app_development/frameworks/flutter/packages/flutter/lib/src/material/animated_icons.dart:10:8: Error: Not found: 'dart:ui'
  import 'dart:ui' show lerpDouble;
         ^
  file:///C:/Users/random_user/Documents/app_development/frameworks/flutter/packages/flutter/lib/src/material/app.dart:5:8: Error: Not found: 'dart:ui'
  import 'dart:ui' as ui;
         ^
  file:///C:/Users/random_user/Documents/app_development/frameworks/flutter/packages/flutter/lib/src/material/app_bar_theme.dart:5:8: Error: Not found: 'dart:ui'
  import 'dart:ui' show lerpDouble;
         ^
  file:///C:/Users/random_user/Documents/app_development/frameworks/flutter/packages/flutter/lib/src/material/arc.dart:6:8: Error: Not found: 'dart:ui'
  import 'dart:ui' show lerpDouble;
         ^
  file:///C:/Users/random_user/Documents/app_development/frameworks/flutter/packages/flutter/lib/src/material/bottom_app_bar_theme.dart:5:8: Error: Not found: 'dart:ui'
  </code></pre>