project.xcproj: unresolvedPackage when a repository URL ends in an extension other than .git
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 76/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- swift
- Domain
- backend-api-design
Research direction
Start with XCRemoteSwiftPackageReference.name, then trace how XCProjDecoder.makePackageProductDependency uses packagesByName and how the encoder derives package names. Reproduce the failure with a repository URL ending in .ios_sdk; done means the project loads and package identity handling matches SwiftPM's removal of the full path extension.
Written by the indexing model from the issue text.
Description
Summary
Decoding a project.xcproj fails with XCProjError.unresolvedPackage when a remote package's repository URL ends in a path extension other than .git. Xcode 27.2 writes the package's SwiftPM identity into package-product-members, but XCProjDecoder looks packages up by XCRemoteSwiftPackageReference.name, which only strips .git.
Reproduction
- Add
https://github.com/Ometria/ometria.ios_sdkas a package dependency in an Xcode project. - Convert it with
xcodebuild -project App.xcodeproj -convert-project "Xcode Project"(or the Project Format menu in Xcode 27.2). - Load the project with XcodeProj (we hit it through Periphery).
The converted file contains:
"packages": [
{
"kind": "remote",
"repository": "https://github.com/Ometria/ometria.ios_sdk",
"version": { "up-to-next-major-version": "1.9.1" },
},
],
...
"package-product-members": [
{
"package": "ometria",
"product-name": "Ometria",
"build-phase": { "build-phase": "frameworks" },
},
],
Actual
Error: (XCProjError) The project has no Swift package named 'ometria'
Expected
The project loads. Xcode and xcodebuild -list read the same file without problems.
Cause
XCRemoteSwiftPackageReference.name is:
repositoryURL?.split(separator: "/").last?.replacingOccurrences(of: ".git", with: "")
which gives ometria.ios_sdk. Xcode drops the whole path extension, as SwiftPM does when deriving a package identity from a URL, giving ometria. Other packages in the same project keep their casing (MobileSDK-iOS), so only the extension handling differs. XCProjDecoder.makePackageProductDependency then misses packagesByName["ometria"].
Deriving the name used by packagesByName (and by the encoder) with the path extension removed, instead of only .git, would fix it.
Environment
- Xcode 27.2 (27B52)
- Periphery 1.0.0.beta.9 with XcodeProj's
project.xcprojsupport
- Dominant language
- Swift
- Stars
- 2.2k
- Forks
- 356
- Avg merge
- 4h 48m
- Merged PRs (30d)
- 10
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from tuist/XcodeProj
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
tuist/XcodeProj#1198 · 1 reaction ·
Maintainers usually reply within 1 day
-
New Xcode 26 formatOpen
Difficulty 1/5 Under an hour Newbie friendliness 85/100
tuist/XcodeProj#1137 · 1 reaction ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 52/100
tuist/XcodeProj#1154 · 2 comments · 2 reactions ·
Maintainers usually reply within 1 day
-
Removing a target referenced by PBXFileSystemSynchronizedBuildFileExceptionSet crashes serializationOpen
Difficulty 4/5 3-5 days Newbie friendliness 55/100
tuist/XcodeProj#1093 · 2 comments · 1 reaction ·
Maintainers usually reply within 1 day
-
PBXProjEncoder crashes when sorting projectReferences if ProjectRef file element has nil namePossibly taken @Ant-tree claimed this 269 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 35/100
tuist/XcodeProj#1055 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
rock3r/remozio#600 · 1 comment ·
Maintainers usually reply within 1 day
-
Bug JSON
Difficulty 1/5 Under an hour Newbie friendliness 83/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
nightscout/Trio#1748 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
carp-dk/flutter-plugins#1312 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
newrelic/newrelic-flutter-agent#256 ·
Maintainers usually reply within 1 day