Build error when adding a dependency using Swift Package Manager in Xcode for a Flutter project
6,429
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!
Author by
matteoh
Updated on December 27, 2022Comments
-
matteoh over 1 year
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.
-
fartem over 3 years
-
matteoh over 3 years@fartem Thanks, I've already seen that one actually, but I still don't manage how to fix the problem (I'm on the stable 1.22.5 version of Flutter, Cocoapods installed)
-
-
matteoh about 3 yearsYup, I got the same answer on the Flutter Github ;) Thanks!
-
Eray Hamurlu almost 3 yearsI got this error after adding facebook sdk .and fixed my issue