matteoh
matteoh

Reputation: 3590

Build error when adding a dependency using Swift Package Manager in Xcode for a Flutter project

In my Flutter project, I need to add dependencies on the native iOS part of my project.

For that, I use Swift Package Manager.

But each time I try to run my app, after adding a dependency, I get the following build error:

ProcessException: Process exited abnormally:
Command line invocation:
    /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -list


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

More details here.

Since I'm new to iOS development, how can I add dependencies in Xcode so my Flutter app works?

Thanks.

Upvotes: 1

Views: 11831

Answers (1)

aspirant_sensei
aspirant_sensei

Reputation: 1673

I think I might have the fix for you.

Please close your workspace in XCode, and go back and open the .xcodeproj file INSTEAD of the .xcworkspace file.

(/yourApp/ios/Runner.xcodeproj most likely)

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

Change the option from LEGACY to XCODE DEFAULT.

Now open the .xcworkspace again and it should work!

Upvotes: 12

Related Questions