UPDATE: As some others have mentioned, this can be fixed by simply closing Xcode and re-opening it, then doing a regular build (Command+B) instead of running it. Give that a shot before trying the other options!
The error seemed to be resolved by doing the following:
- Close Xcode
- Open finder, and delete the derived data folder:
~/Library/Developer/Xcode/DerivedData
- Open finder, CMD+SHIFT+G and go to
~/Library/Caches/org.swift.swiftpm
. Right-click > Show Package Contents, and delete therepositories
folder andrepositories.lock
file. - Open Xcode and let it build naturally
Coworker also resolved this by deleting derived data, rebuilding on Xcode 14.1 or 14.2, and then switching back to Xcode 14.3. Will try these steps again next time I see it to confirm if this is a reliable fix.