Package.resolved file is corrupted or malformed; fix or delete the file to continue: unknown ‘PinsStorage’ version ‘3’

MyGrandmaIsFlower
1 min readAug 5, 2024

--

Missing package product ‘ ’

When cloning a new project and trying to build it, you might encounter the error: "Package.resolved file is corrupted or malformed; fix or delete the file to continue: unknown 'PinsStorage' version '3'" and "Missing package product."

Here's what I tried:

  1. Reset Package Caches: From Xcode, go to FilePackagesReset Package Caches. Unfortunately, this didn't work.
  2. Delete DerivedData: I deleted the DerivedData, but the issue persisted.

Here’s the solution that worked for me:

Step 1. Close Your Project: Close the Xcode project.

Step 2. Delete the Package.resolved File:

  • Open Finder and locate your project.xcodeproj.
  • Right-click on it and select Show Package Contents.
  • Navigate to project.xcworkspacexcshareddataswiftpm.
  • Delete the Package.resolved file and empty the bin.

Step 3. Reopen Your Project: Open the project in Xcode.

Step 4. Build Your Project: The project should build successfully now.

The Package.resolved file is similar to a Podfile.lock in CocoaPods. When you encounter package issues, deleting it and rebuilding the project will generate a new one.

If this post helped you, please give me a 👏.

--

--

MyGrandmaIsFlower

⠀一轉金融業理專⠀⠀⠀⠀二轉iOS工程師⠀ ⠀記錄實作經驗⠀⠀⠀⠀⠀分享問題解法