I’ve local Swift Packages added to a workspace. They reside in the project subfolders and connected to different git repositories as git submodules. Everything had been working perfectly (the project was able to build, packages were able to resolve, and I could edit the packages within the same workspace).
After I updated Xcode to 13.0, the project started failing to build with multiple errors Missing package product
for each local package dependency. Removing derived data, resetting packages, cleaning build folder and restarting Xcode didn’t help.
7
Answers
Removing package references from workspace and re-adding them (by simple drag-n-drop from Finder) resolved the problem.
I even didn't need to reconfigure corresponding schemes, or re-adding dependencies in targets.
This is what worked for me:
Alternatively, removing an unused package in the Target -> Build Phases -> Link Binary With Libraries, also removed the errors for me.
Quit Xcode
Open Terminal
Navigate to the directory where your
.xcodeproj
is via Terminal (cd path/to/your/apps/folder
)Run
xcodebuild -resolvePackageDependencies
After the packages finish resolving, open Xcode and try building again.
If @lazarevzubov’s answer doesn’t help, try few additional steps:
Binary with Libraries
xcodebuild -resolvePackageDependencies
In XCode,
File > Swift Packages > Reset Package Caches
In my case, the problem was an expired certificate on GitHub. I had to create a new certificate so that packages could be loaded.
This has occasionally happened to me when I have the package I want to use as a local package open in other Xcode windows. Closing other Xcode windows that have that package project open or are also using it as a local package may help. (Close those other windows, then try re-adding it as a local package.)