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?

  • 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.

Add a Comment

Accepted Reply

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.

Replies

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.

  • Thank you @GravityBytes for posting this. I bumped into this issue today and your tip turned out to be the solution for me too.

    The only difference in my setup was that the packages were part of a workspace. I removed their reference and added them back and the build started to work again. The delete + re-add of the package references to the workspace file resulted in a clean diff.

    I'd say this is some quirk in the way Xcode caches stuff. Some folks on StackOverflow suggested to reset the packages cache. I did that but it was no help because the issue was with a local package not a remote one.

  • Thanks, solved my problem too!

Add a Comment

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

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

  • This solved my issue. No clue why or how it's related. Don't forget to try this if your seeing something similar

Add a Comment

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

  • This worked for me too

  • Same here. Thanks!

  • Thanks! for my case, I need to reset cache and also update the packages.

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.