skip to Main Content

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


  1. Chosen as BEST ANSWER

    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.


  2. This is what worked for me:

    • Click on the project file then go to Project (not a target) -> Package Dependences tab.
    • Double-click on any Package and copy the location URL to clipboard.
    • Remove that Package using the – button.
    • Add it back, pasting the URL.
    • Clean Build Folder, then Build.

    Alternatively, removing an unused package in the Target -> Build Phases -> Link Binary With Libraries, also removed the errors for me.

    Login or Signup to reply.
    1. Quit Xcode

    2. Open Terminal

    3. Navigate to the directory where your .xcodeproj is via Terminal (cd path/to/your/apps/folder)

    4. Run xcodebuild -resolvePackageDependencies

    5. After the packages finish resolving, open Xcode and try building again.

    Login or Signup to reply.
  3. If @lazarevzubov’s answer doesn’t help, try few additional steps:

    • Open xcode
    • Delete one or couple of libs under Build Phases / Link
      Binary with Libraries
    • Discard changes under git
    • Clean project
    • Close xcode
    • Run xcodebuild -resolvePackageDependencies
    • Open xcode again and try to build
    Login or Signup to reply.
  4. In XCode,

    File > Swift Packages > Reset Package Caches

    Login or Signup to reply.
  5. In my case, the problem was an expired certificate on GitHub. I had to create a new certificate so that packages could be loaded.

    Login or Signup to reply.
  6. 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.)

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search