title: Build error when adding a dependency using Swift Package Manager in Xcode for a Flutter project
body: <p>In my Flutter project, I need to add dependencies on the native iOS part of my project.</p>
  <p>For that, I use Swift Package Manager.</p>
  <p>But each time I try to run my app, after adding a dependency, I get the following build error:</p>
  <pre><code>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
  </code></pre>
  <p>More details <a href="https://github.com/flutter/flutter/issues/74586" rel="nofollow noreferrer">here</a>.</p>
  <p>Since I'm new to iOS development, how can I add dependencies in Xcode so my Flutter app works?</p>
  <p>Thanks.</p>