karelklic · GitHub

Describe the bug
The Flutter app cannot be launched from VSCode (launch.json) on macOS, as it fails to download SwiftPM dependencies via Git. The same app launched from the VSCode terminal with flutter run starts normally.

To Reproduce
Steps to reproduce the behavior:

Use launch.json to configure a Flutter app on macOS:

{
    // https://dartcode.org/docs/launch-configuration/
    "version": "0.2.0",
    "configurations": [
        {
            "name": "app",
            "cwd": "app",
            "request": "launch",
            "type": "dart",
            "program": "lib/main.dart"
        }
  ]
}
  1. Run flutter clean in the project to force SwiftPM dependency resolution.

  2. Launch the app with "Run and Debug" / "Start Debugging (F5)".

  3. Watch it fail in "Debug Console"

Launching lib/main.dart on macOS in debug mode...
Error: An error occurred when adding Swift Package Manager integration:
  Error: Unable to get Xcode project information:
 2026-06-04 11:14:15.417 xcodebuild[15742:1092727] Writing error result bundle to /var/folders/vh/glwz5khd2zxcr2kkhcgz1f5r0000gp/T/ResultBundle_2026-04-06_11-14-0015.xcresult
xcodebuild: error: Could not resolve package dependencies:
  Couldn’t get revision ‘1ee46d19a4f451a7aa64ffc64fc99b4748131e62^{commit}’:
3
Swift Package Manager is currently an experimental feature, please file a bug at
  https://github.com/flutter/flutter/issues/new?template=01_activation.yml
Consider including a copy of the following files in your bug report:
  macos/Runner.xcodeproj/project.pbxproj
  macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme (or the scheme for the flavor used)
To add Swift Package Manager integration manually, please use the following instructions:
https://docs.flutter.dev/to/add-swift-package-manager-manually
You can also disable Swift Package Manager for the project by following these instructions:
  https://docs.flutter.dev/packages-and-plugins/swift-package-manager/for-app-developers#how-to-turn-off-swift-package-manager
Disabling Swift Package Manager will not be allowed in a future version of Flutter.

Note that this is not an issue with an invalid SwiftPM dependency or Git revision. Even after removing the affected dependency, SwiftPM fails on another Git repository due to a different Git issue (e.g., "Cannot list tags").

  1. Run the same program with flutter run -d macos. See it launching just fine.

Expected behavior
The app should start normally when launched from VSCode's "Run and debug".

Please complete the following information:

Workspace Environment
Dart Code extension: 3.136.0
Flutter extension: 3.136.0 (activated)
App: Visual Studio Code
App Host: desktop
Version: mac 1.123.0
Workspace type: Dart, Flutter (LSP)
Workspace name: apps
Dart (3.12.1): /opt/homebrew/Caskroom/flutter/3.27.1/flutter/bin/cache/dart-sdk
Flutter (3.44.1): /opt/homebrew/Caskroom/flutter/3.27.1/flutter (macOS (darwin/macos))
Output from 'dart info'

/opt/homebrew/Caskroom/flutter/3.27.1/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.12.1 (stable) (Tue May 26 01:02:21 2026 -0700) on "macos_arm64"
  • on macos / Version 26.5.1 (Build 25F80)
  • locale is en-CZ

Project info

  • sdk constraint: '>=3.12.0 <4.0.0'
  • dependencies:
  • dev_dependencies: args, cli_script, dio, glob, jinja, path, yaml
  • elided dependencies: 5

Process info

Memory CPU Elapsed time Command line
15 MB 0.0% 01:10:51 dart development-service --vm-service-uri=http:/ --bind-address=127.0.0.1 --bind-port=0 --serve-devtools --devtools-server-address=http:/ --app-name=Kind: Flutter - Device: macOS - Package: managry_traverse
9 MB 0.0% 01:19:21 dart devtools --machine --allow-embedding --dtd-uri ws:/2dsQ0SIMCVY= --port 9100
9 MB 0.0% 02:20:06 dart devtools --machine --allow-embedding --dtd-uri ws:/f-pN7Jh0Vuo= --port 9100
117 MB 0.0% 02:20:06 dart language-server --protocol=lsp --client-id=VS-Code --client-version=3.136.0
11 MB 0.0% 02:20:06 dart tooling-daemon --machine
28 MB 0.3% 02:20:06 flutter_tools.snapshot daemon
25 MB 0.0% 01:11:35 flutter_tools.snapshot debug_adapter
23 MB 0.0% 01:11:34 flutter_tools.snapshot run --machine --start-paused -d macos --devtools-server-address http:/ --target /main.dart
Output from 'flutter doctor'

/opt/homebrew/Caskroom/flutter/3.27.1/flutter/bin/flutter doctor -v

[✓] Flutter (Channel stable, 3.44.1, on macOS 26.5.1 25F80 darwin-arm64, locale en-CZ) [1,758ms]
    • Flutter version 3.44.1 on channel stable at /opt/homebrew/Caskroom/flutter/3.27.1/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 924134a44c (6 days ago), 2026-05-29 12:13:22 -0400
    • Engine revision c416acfeb8
    • Dart version 3.12.1
    • DevTools version 2.57.0
    • Feature flags: enable-web, enable-linux-desktop, enable-macos-desktop, enable-windows-desktop, enable-android, enable-ios, cli-animations, enable-native-assets, enable-swift-package-manager, omit-legacy-version-file, enable-lldb-debugging, enable-uiscene-migration
[✗] Android toolchain - develop for Android devices [1,140ms]
    ✗ Unable to locate Android SDK.
      Install Android Studio from: https://developer.android.com/studio/index.html
      On first launch it will assist you in installing the Android SDK components.
      (or visit https://flutter.dev/to/macos-android-setup for detailed instructions).
      If the Android SDK has been installed to a custom location, please use
      `flutter config --android-sdk` to update to that location.
[✓] Xcode - develop for iOS and macOS (Xcode 26.5) [2.7s]
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 17F42
    • CocoaPods version 1.16.2
[✓] Chrome - develop for the web [4ms]
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Connected device (2 available) [7.5s]
    • macOS (desktop) • macos  • darwin-arm64   • macOS 26.5.1 25F80 darwin-arm64
    • Chrome (web)    • chrome • web-javascript • Google Chrome 148.0.7778.217
    ! Error: Browsing on the local area network for Karel’s iPhone. Ensure the device is unlocked and attached with a cable or associated with the same local area network as this Mac.
      The device must be opted into Developer Mode to connect wirelessly. (code -27)
[✓] Network resources [646ms]
    • All expected network resources are available.
! Doctor found issues in 1 category.

Read the original on github.com ↗