Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode 11.4 compile error 'Missing package product <package name>'

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.

like image 328
blackjacx Avatar asked Mar 31 '20 14:03

blackjacx


People also ask

How do I reset my package cache?

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.

How do I add package dependencies to Xcode?

To add a package dependency to your Xcode project, select File > Swift Packages > Add Package Dependency and enter its repository URL.

What is SPM in Xcode?

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.


1 Answers

Solution 1: File > Swift Packages > Reset Package Caches

enter image description here

Solution 2: File > Swift Packages > Update to Latest Package Versions

enter image description here

like image 83
XpressGeek Avatar answered Sep 16 '22 16:09

XpressGeek