Xcode 13 "Missing package product" using local Swift Packages

I have a project I've been working off of for a few years now that makes use of local Swift Packages. In my workspace, I have a "Kit" project that generates a framework using several local Swift Packages as dependencies.

In Xcode 12, the local Swift packages resolve correctly and compiles, but each beta of Xcode 13 gives me the error: "[ProjectName].xcodeproj Missing package product '[LocalSwiftPackage]'"

Clearing the package cache, derived data, or restarting the application does not resolve the issue. Only Swift Packages that are remotely loaded from a URL are compiled correctly.

Using local packages to separate module code, while still being able to edit in the same project, has been essential to my workflow and would hate to see Xcode 13 release with these breaking changes, and I have not seen this issue listed in the known issues for the Xcode 13 release notes.

Has anyone else experienced this issue or found a workaround?

Answered by neur0 in 686686022

Check if Xcode 13 resides in Application folder. In my case it was in Downloads folder, moving it to Application folder solved the problem for me.

This started happening for me in Xcode 13 beta 5. I repeatedly delete derived data, reset the package cache, after many attempts it may finally work. Extremely frustrating.

Accepted Answer

Check if Xcode 13 resides in Application folder. In my case it was in Downloads folder, moving it to Application folder solved the problem for me.

I eventually got this resolved. What seemed to get it working was re-adding my local packages using the "Add Packages…" menu option on the project that has the framework targets using the local package. This created a new "Packages" group in the project, and eventually started compiling correctly.

I also had been using the "Watchdog" app, which I have since disabled as I think it was causing issues when it would delete derived data.

I'm also seeing this in Xcode 13.0 final release.

The thing that worked for me was to disable the thread sanitizer.

In my case on Xcode 13.1, this issue get fixed after applying File -> Packages -> Reset Package Caches enjoy!

94

Xcode 13.3, same issues, i removed all the embedded frameworks and re-added them, and it worked.

XCode 12.3 issue on Catalina appeared after deleting DerivedData Folder for project. Closing and re-opening XCode project, and cleaning build folder eventually worked.

I tried:

  • Clean project
  • Clean derived data
  • Resolve Package Versions (File > Package)
  • Update to Latest Package Versions (File > Package)
  • Restarted Xcode
  • Restarted Mac

And restarting the Mac is what worked 🥲

I got the "Missing package product" error when including a local Swift Package in two xcode projects simultaneously (Xcode 13.4.1). My solution was to close one of the projects and then the error went away. It seems it is not possible to use the same local package simultaneously in two open projects.

It still appears 2-3 times a week, a need to waste approx 0,5 hours to fix it every time. Please, fix this problem in Xcode, Apple developers :)

In my case I got the local package open in another window. In the past it will give a more specific error saying the package is open, but now it doesn't.

File -> Packages -> Update to latest version. works for me.

EVERY DAY my Xcode welcomes me with missing packages problems. Yes, "Reset Package Caches" works but really Apple, fix this horrible issue, still present in Version 14.3 (14E222b)

Thank you. Removing and adding the local packages again also fixed my issue with XCode 14.3.1.

Xcode 13 "Missing package product" using local Swift Packages
 
 
Q