pod install cannot download from the CocoaPods trunk
trunk URL couldn't be downloadedShort answer
CocoaPods now fetches specs from a CDN, not from a cloned git copy of the master repo. If your Podfile or local setup still points at the old git source, downloads can fail. Set the Podfile source to the CDN, remove the old master repo, then run pod update because the source change breaks the lockfile.
Fix it fast
1Find out which cause you have
Show which spec sources CocoaPods has and which one your Podfile names.
pod repo list grep -n "^source" Podfile2Match what you see, then jump to its fix
- 1
pod repo list shows a master repo cloned from GitHub, or the Podfile has the github.com/CocoaPods/Specs.git source lineThe Podfile or the machine still uses the old git master repoFix - 2
After editing the source line, pod install complains about the lockfile or wants different specsThe source changed, so Podfile.lock no longer matchesFix
- 1
What does the error look like?
trunk URL couldn't be downloaded
Cause 1 of 2
The Podfile or the machine still uses the old git master repo
1Check
Since CocoaPods 1.8 the CDN is the default source, and the git master source is used only when the Podfile names it. An old Podfile with the git line keeps using it.
grep -n "CocoaPods/Specs" Podfile
pod repo list2Fix
Replace the git source line with the CDN source, then drop the old master repo from the managed list.
# Podfile
source 'https://cdn.cocoapods.org/'
# shell
pod repo remove master3Verify
pod repo list no longer shows the git master repo, and pod install can resolve pods.
pod installConfirmed by blog.cocoapods.org
Cause 2 of 2
The source changed, so Podfile.lock no longer matches
1Check
Changing the spec source invalidates the entries in Podfile.lock. It may also pull in newer pod versions.
git diff --stat Podfile.lock2Fix
Run pod update once, review the diff of Podfile.lock, and commit it.
pod update
git diff Podfile.lock3Verify
A plain pod install now finishes without errors.
pod installConfirmed by blog.cocoapods.org
How do I stop it coming back?
- Name the CDN source explicitly in the Podfile, and keep any private specs source below it.
- On CI, cache the CocoaPods repos directory so each job does not download everything again.
- Read the CocoaPods trunk read-only notice: the project plans to stop accepting new pods and versions on trunk, and existing builds should keep working.
Sources
How was this page made?
I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.
Which stack is behind this page?
Related fixes
Mobile apps
pod install cannot pick a version of a pod that satisfies every requirement
Specs satisfying the `FirebaseAuth (~> 11.0)` dependency were found, but they required a higher minimum deployment target.
CocoaPods tried every version of the named pod and none fit all requirements.
4 causes, each with a fixMobile apps
Cannot change the App Privacy answers in App Store Connect
Publish Your App Privacy Responses?
Only the Account Holder, Admin and App Manager roles can answer the App Privacy questions.
2 causes, each with a fixMobile apps
App record creation fails because you lack permission
You cannot add a new app in App Store Connect as a Developer or limited user
Only the Account Holder, an Admin or an App Manager can create an app record, and Apple blocks it until the Account Holder has signed the latest agreement.
3 causes, each with a fixMobile apps
You cannot find the button to pull your app back from review
No 'remove this version from review' message appears on the version page
There is no button called Reject Binary.
3 causes, each with a fixMobile apps
Your Apple Account cannot sign in to App Store Connect
Sign-in to App Store Connect is refused for an account that should have access
App Store Connect does not open to every Apple Account.
3 causes, each with a fixMobile apps
Apple rejected the app under Guideline 4.3, Design: Spam
Guideline 4.3(b) - Design - Spam
Guideline 4.3 is Apple's duplicate rule.
5 causes, each with a fix