Package.resolved file is corrupted or malformed; fix or delete the file
In this article, I made my Pod library compatible to Swift Package Manager. This time, I tried to build one of my app on Github workflow, which replaced Pod library with SPM version.
However I met this error.
Package.resolved file is corrupted or malformed; fix or delete the file to continue
What is this?
Package.resolved
{
"originHash" : "...",
"pins" : [
{
"identity" : "lsextensions",
"kind" : "remoteSourceControl",
"location" : "https://github.com/2sem/LSExtensions",
"state" : {
"revision" : "...",
"version" : "0.1.22"
}
}
],
"version" : 3
}
I saw the error message again and found out this.
unknown ‘PinsStorage’ version ‘3’
Maybe Xcode on runner image cannot recognize the version 3??
Removing Package.resolved
I googled PinsStorage
and pins
, but I couldn’t find anything. Therefore I decided to remove the file according to Stackoverflow’s solution.
However, before, I checked if I removed the package, Package.resolved file would be removed also.
As I thought, Package.resolved also disappeared when I removed it.
And I add the package, then the version 3
appeared again.
Upgrading Xcode
I checked lastest Xcode version runner image supports.
And select the version in Fastlane.
xcode_select("/Applications/Xcode_15.2.app")
Result was same.
Modifying pins version
Lastly, I tried to modify version
to 2.
"version" : 2
And Success, however… I don’t know why??
I found out old WWDC18 Session, Apple mentioned about Package.resolved(19.43). However there was no what the PinsStorage and version is.
Github Action
You might not want to modify the version each project everytime. So I created Public Github Action. I’m happy to release my first Github Action.
- name: Patch Xcode 15.3
uses: 2sem/patch-package-resolved@v1
If you found this post helpful, please give it a round of applause 👏. Explore more iOS-related content in my other posts.