Open jtarkowski27 opened 1 week ago
@jtarkowski27 are the projects more deeply nested in the problematic workspace?
There is a setting that controls how deep we'll walk through the workspace looking for Dart projects the defaults to 5:
You may need to increase that (which you can do in the Workspace Settings if you want to share for that repo) if your projects are deeper than that.
@DanTup Maximum depth is 2 or 3 (relative to the root of the project) which is packages/app_widgetbook
that has macos
and web
targets. I changed the depth in workspace settings to 10 just to be sure and restarted VSC but it doesn't help my case unfortunately.
Could you try:
F1
to open the command palette"dart.flutterDaemonLogFile": "flutter_daemon.txt",
If there's nothing sensitive in the log you can share it here, otherwise look for lines that call getSupportedPlatforms
and the matching response (by id
):
[10:37:18 AM] [FlutterDaemon] [Info] ==> [{"id":"3","method":"daemon.getSupportedPlatforms","params":{"projectRoot":"C:\\Dev\\Test Projects\\flutter_counter"}}]
[10:37:18 AM] [FlutterDaemon] [Info] <== [{"id":"3","result":{"platforms":["web","android","windows"],"platformTypes":{"web":{"isSupported":true},"android":{"isSupported":true},"ios":{"isSupported":false,"reasons":[{"reasonText":"the iOS platform is not enabled for this project","fixText":"Run \"flutter create --platforms=ios .\" in your application directory","fixCode":"create"}]},"linux":{"isSupported":false,"reasons":[{"reasonText":"the Linux platform is not enabled for this project","fixText":"Run \"flutter create --platforms=linux .\" in your application directory","fixCode":"create"}]},"macos":{"isSupported":false,"reasons":[{"reasonText":"the macOS platform is not enabled for this project","fixText":"Run \"flutter create --platforms=macos .\" in your application directory","fixCode":"create"}]},"windows":{"isSupported":true},"fuchsia":{"isSupported":false,"reasons":[{"reasonText":"the Fuchsia feature is not enabled","fixText":"Run \"flutter config --enable-fuchsia\"","fixCode":"config"},{"reasonText":"the Fuchsia platform is not enabled for this project","fixText":"Run \"flutter create --platforms=fuchsia .\" in your application directory","fixCode":"create"}]},"custom":{"isSupported":false,"reasons":[{"reasonText":"the custom devices feature is not enabled","fixText":"Run \"flutter config --enable-custom-devices\"","fixCode":"config"}]},"windowsPreview":{"isSupported":false,"reasons":[{"reasonText":"the Preview Device feature is not enabled","fixText":"Run \"flutter config --enable-flutter-preview","fixCode":"config"}]}}}}]
In particular, see if there are calls that have the problematic project as the projectRoot
in params
, and what the response looks like.
By the way, I think all those checks currently do is check for the ios
and macos
folders in your project, so I guess it's also worth verifying whether the problematic project has those folders or not. If not, selecting the "Enable macOS" and "Enabled web" options in the device selector will help you create them which may fix the issue.
Describe the bug In one of our projects we have a problem that
macos
andweb
devices are not showing up as "Available devices" for nested flutter application in the project directory that has said targets defined. The problem is that I can't reproduce the issue by replicating the project structure using flutter empty applictions/packages. This tells me that the problematic project has something that messes up with "Dart-Code" VSC extension, but I can't really tell what that is. I would be very grateful if you could explain how "Dart-Code" searches for available devices within the entire opened directory tree. Even better, if you could identify the cause of the issue based solely on the information provided below, it would be immensely helpful.To Reproduce As I mentioned before, I’m unable to provide steps to reproduce the issue since it doesn’t happen with an empty project that has a similar folder structure but on a smaller scale. However, I created an example project that shows up available devices properly, which you can find here:
https://github.com/jtarkowski27/nested_application_example
When you open this example as a workspace in VS Code, you should be able to see all the target devices.
The project where the issue comes up consists of of three modules:
app
that is at the root of the directory (supportsios
andandroid
)app_design_system
which is package of common widgets placed inpackages/app_design_system
app_widgetbook
which is a flutter application that lists up all components fromapp_design_system
and is located atpackages/app_widgetbook
(supportsios
,macos
andweb
)Folder structure looks more or less like this:
Expected behavior "Select a device to use" should all below options (as it does in example that I've made)
Screenshots As you can see
macos
andweb
devices are unavailable to select even thoughapp_widgetbook
has directories for them. This is the screenshot from project where this issue occurs.Please complete the following information:
Output from 'dart info'
`/Users/jakubtarkowski/development/flutter/bin/cache/dart-sdk/bin/dart info` If providing this information as part of reporting a bug, please review the information below to ensure it only contains things you're comfortable posting publicly. #### General info - Dart 3.4.4 (stable) (Wed Jun 12 15:54:31 2024 +0000) on "macos_arm64" - on macos / Version 14.4 (Build 23E214) - locale is en-PL #### Project info - sdk constraint: '>=3.4.0 <4.0.0' - dependencies: bloc_dispose_scope, bloc_presentation, clock, collection, configcat_client, cqrs, enhanced_gradients, firebase_core, firebase_crashlytics, firebase_messaging, firebase_performance, flutter, flutter_bloc, flutter_gen, flutter_hooks, flutter_local_notifications, flutter_localizations, flutter_native_splash, flutter_svg, freezed_annotation, go_router, google_sign_in, http, intl, json_annotation, jwt_decoder, leancode_contracts, leancode_cubit_utils, leancode_debug_page, leancode_flutter_svg_adaptive_loader, leancode_forms, leancode_hooks, logging, logging_bugfender, package_info_plus, provider, shared_preferences, sign_in_with_apple, timeago, timeago_flutter, url_launcher, uuid - dev_dependencies: bloc_test, build_runner, custom_lint, flutter_gen_runner, flutter_launcher_icons, flutter_test, freezed, go_router_builder, integration_test, json_serializable, leancode_lint, patrol - elided dependencies: 9 #### Process info | Memory | CPU | Elapsed time | Command line | | ------: | ---: | -----------: | ------------------------------------------------------------------------------- | | 27 MB | 0.0% | 12:25:16 | dart devtools --machine --allow-embedding --dtd-uri ws:Output from 'flutter doctor'
`/Users/jakubtarkowski/development/flutter/bin/flutter doctor -v` ```text [✓] Flutter (Channel stable, 3.22.3, on macOS 14.4 23E214 darwin-arm64, locale en-PL) • Flutter version 3.22.3 on channel stable at /Users/jakubtarkowski/development/flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision b0850beeb2 (7 weeks ago), 2024-07-16 21:43:41 -0700 • Engine revision 235db911ba • Dart version 3.4.4 • DevTools version 2.34.3 [✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0) • Android SDK at /Users/jakubtarkowski/Library/Android/sdk • Platform android-34, build-tools 34.0.0 • ANDROID_HOME = /Users/jakubtarkowski/Library/Android/sdk • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 17.0.11+0-17.0.11b1207.24-11852314) • All Android licenses accepted. [✓] Xcode - develop for iOS and macOS (Xcode 15.3) • Xcode at /Applications/Xcode.app/Contents/Developer • Build 15E204a • CocoaPods version 1.15.2 [✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome [✓] Android Studio (version 2024.1) • Android Studio at /Applications/Android Studio.app/Contents • Flutter plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/6351-dart • Java version OpenJDK Runtime Environment (build 17.0.11+0-17.0.11b1207.24-11852314) [✓] IntelliJ IDEA Community Edition (version 2023.1.7) • IntelliJ at /Applications/IntelliJ IDEA CE.app • Flutter plugin version 78.2.1 • Dart plugin version 231.9414.10 [✓] VS Code (version 1.92.2) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension version 3.96.0 [✓] Connected device (5 available) • kubakubakuba (2) (mobile) • 00008110-001875C0140A201E • ios • iOS 17.5.1 21F90 • iPhone 15 Pro (mobile) • 361351EA-5008-47AC-BCEA-7F573E2D343C • ios • com.apple.CoreSimulator.SimRuntime.iOS-17-4 (simulator) • macOS (desktop) • macos • darwin-arm64 • macOS 14.4 23E214 darwin-arm64 • Mac Designed for iPad (desktop) • mac-designed-for-ipad • darwin • macOS 14.4 23E214 darwin-arm64 • Chrome (web) • chrome • web-javascript • Google Chrome 128.0.6613.119 [✓] Network resources • All expected network resources are available. • No issues found! ```