Skip to main content
All CollectionsKnowledge BaseCross-platform
error: Could not resolve package dependencies in Flutter
error: Could not resolve package dependencies in Flutter
Updated over a week ago

Issue:

When adding a dependency with Swift Package Manager in Xcode for a Flutter project, your build fails with this error message:

xcodebuild: error: Could not resolve package dependencies:
  Packages are not supported when using legacy build locations, but the current project has them enabled.
  Command: /usr/bin/xcodebuild -list

Possible solutions:

  1. Close your workspace in Xcode.

  2. Open the .xcodeproj file INSTEAD of the .xcworkspace file (most likely /yourApp/ios/Runner.xcodeproj).

  3. When the project is open, in the Xcode menu bar click File -> Project Settings -> Advanced.

  4. Change the option from LEGACY to XCODE DEFAULT.

  5. Open the .xcworkspace again and it should work!

Did this answer your question?