Flutter projects nested more than 2 levels deep do not force "Flutter mode", preventing launching/debugging apps
See original GitHub issueFolder structure
- /monorepo_root
- apps
- app1
- lib/main.dart
- app2
- lib/main.dart
- app1
- apps
Works
- File > Open Folder (app1)
- Start Debugging
Doesn’t work
- File > Open Folder (monorepo_root)
- In Explorer right click on app1/lib/main.dart
- Select Start Debugging
lib/main.dart:1: Warning: Interpreting this as package URI, 'package:app1/main.dart'.
file:///C:/src/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:/src/flutter/packages/flutter/lib/src/material/animated_icons.dart:10:8: Error: Not found: 'dart:ui'
import 'dart:ui' show lerpDouble;
^
file:///C:/src/flutter/packages/flutter/lib/src/material/app.dart:5:8: Error: Not found: 'dart:ui'
import 'dart:ui' as ui;
^
file:///C:/src/flutter/packages/flutter/lib/src/material/app_bar_theme.dart:5:8: Error: Not found: 'dart:ui'
import 'dart:ui' show lerpDouble;
^
file:///C:/src/flutter/packages/flutter/lib/src/material/arc.dart:6:8: Error: Not found: 'dart:ui'
import 'dart:ui' show lerpDouble;
^
file:///C:/src/flutter/packages/flutter/lib/src/material/bottom_app_bar_theme.dart:5:8: Error: Not found: 'dart:ui'
import 'dart:ui' show lerpDouble;
^
file:///C:/src/flutter/packages/flutter/lib/src/material/card_theme.dart:5:8: Error: Not found: 'dart:ui'
import 'dart:ui' show lerpDouble;
^
file:///C:/src/flutter/packages/flutter/lib/src/material/chip_theme.dart:5:8: Error: Not found: 'dart:ui'
import 'dart:ui' show lerpDouble;
^
file:///C:/src/flutter/packages/flutter/lib/src/material/colors.dart:5:8: Error: Not found: 'dart:ui'
import 'dart:ui' show Color;
^
file:///C:/src/flutter/packages/flutter/lib/src/material/dialog_theme.dart:5:8: Error: Not found: 'dart:ui'
import 'dart:ui' show lerpDouble;
^
Exited (sigint)
Issue Analytics
- State:
- Created 5 years ago
- Reactions:3
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Flutter's build modes
Describes Flutter's build modes and when you should use debug, release, or profile mode. ... The rest of the page goes into more...
Read more >How do I debug a flutter app in vscode if the launch program is ...
This happens only when my main program is nested more than two levels deep.I have a deeply nested folder structure (given below). The...
Read more >Restrictions on starting activities from the background
Android 10 (API level 29) and higher place restrictions on when apps can start activities when the app is running in the background....
Read more >Flutter keep app running in background - cattolimonica.it
A plugin to keep flutter apps running in the background. ... Skil Running Flutter apps on Android is more perilous than you might...
Read more >Flutter - Google Developers
With the release of Flutter 3 in May 2022, Flutter announced stable support for ... The most recent quarter was no exception —...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks for the update! I’ll keep this open because I think we should do a better job of guiding people here (the error when trying to run a Flutter project on the Dart VM is cryptic for one), even if it’s just detecting the failure and linking them to a page/issue that describes the above.
This is expected right now. When deciding whether to load the Flutter SDK or Dart SDK, we look two levels down to see if there’s a Flutter project, and if not, we go into “Dart Mode”.
If you can’t open a folder closer to the apps, the best current fix is to click File -> Add Folder to Workspace and then select your app1/app2 folders which will show them in the Explorer tree as “Workspace Folders”. Unfortunately, this means they will appear in two places in the tree - there is a request to fix that in VS Code at https://github.com/Microsoft/vscode/issues/45470 (please add a 👍 ).
We could scan further down the tree looking for Flutter projects at startup, but it would slow down startup (significantly for those opening large trees) and doing it this way also prevents you from having your own settings/launch configs within each of the apps folders.