When I integrate a local package in my Xcode project everything is fine initially but when i switch branches and want to run the app Xcode gives me the compile error Missing package product <package name>
. When I quit Xcode and re-open it everything is fine again. Any idea what this can be? An Xcode bug?
We also integrate external packages via Swift Package Manager which works perfectly fine. No issues there.
The issue is also well described in a post by Jesse Squires.
Resetting the Xcode Package Cache: To reset the package cache, open the File menu, navigate to Packages, and click Reset Package Caches. This will delete all local package data and redownload each package from its source online.
To add a package dependency to your Xcode project, select File > Swift Packages > Add Package Dependency and enter its repository URL.
Also known as SwiftPM or SPM, it's been included in Swift since version 3.0. From the official repository: The Swift Package Manager is a tool for managing distribution of source code, aimed at making it easy to share your code and reuse others' code.
Solution 1: File > Swift Packages > Reset Package Caches
Solution 2: File > Swift Packages > Update to Latest Package Versions
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With