I have a Swift project which has a dependency on Apple's Swift Collections package. I've added the package to the project and everything works fine when building from Xcode (for both Debug and Release).
But when I try to build from the command line with xcodebuild, the build fails with an error:
/Users/Robert/XCode/Solitaire-Solver/Solitaire-Solver/Moves.swift:9:8: error: no such module 'Collections'
import Collections
^
** BUILD FAILED **
The following build commands failed:
CompileSwift normal arm64 (in target 'Solitaire-Solver' from project 'Solitaire-Solver')
CompileSwiftSources normal arm64 com.apple.xcode.tools.swift.compiler (in target 'Solitaire-Solver' from project 'Solitaire-Solver')
At the start of the build, xcodebuild outputs the following, so it appears to be finding the dependency fine.
Resolved source packages:
swift-collections: https://github.com/apple/swift-collections.git @ 1.0.2`
Any ideas on what is failing and how to resolve it? I am on Version 13.2.1 of Xcode.