Hello,
I'm having this issue that Xcode tells me it cannot find the Swift Packages I'm using within my App. When I first open Xcode, all the Package Dependencies are listed correctly in my project navigator. Also, building the app for the first time runs without any issues.
But right after the first build is finished, the Package Dependencies are not listed any more and the build fails, telling me that all the packages are missing.
I have to manually click on File -> Packages -> Reset Package Caches, after that it works again. But only for exactly one build. I basically have to do this step for every single build.
I found out that there is this Package.resolved file which lists all the used packages with their respective version and some kind of hash. This file is located inside the .xcodeproj
file, in my case it's this location:
MyApp.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
This file is deleted after the successful build. And I think that's the reason why all of a sudden Xcode screams that the packages are missing. After resetting the package caches this file re-appears. But it seems it has to be regenerated every single time.
This bug is VERY annoying and exists already since the last view versions of Xcode, not just the latest one. I was hoping this bug is fixed at some point.
Current Xcode version: 15.4 (15F31d)
MacBook Air 13", M3, 2024 running macOS Sonoma 14.5
Just in case, my Package.resolved
file is attached below.