When adding a local Swift package to your Xcode project, you might encounter the following error:

Missing package product `PACKAGE_NAME`

The issue often occurs when the package you’re trying to add is already open in Xcode. To resolve:

  1. Close the package in Xcode.
  2. Close your main project.
  3. Reopen your main project.

I’m not sure what might be causing this issue or why reopening the project is required (a clean build won’t do).

To learn more about local Swift packages read Working with Local Swift Packages.