Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4072 pages
Flutter and app store releases

pod install cannot download from the CocoaPods trunk

Errortrunk URL couldn't be downloaded

Short 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.

  • Applies to CocoaPods 1.16, macOS 15
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Fix it fast

  1. 1Find out which cause you have

    Show which spec sources CocoaPods has and which one your Podfile names.

    pod repo list
    grep -n "^source" Podfile
  2. 2Match what you see, then jump to its fix

    1. 1pod 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. 2After editing the source line, pod install complains about the lockfile or wants different specsThe source changed, so Podfile.lock no longer matchesFix

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 list

2Fix

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 master

3Verify

pod repo list no longer shows the git master repo, and pod install can resolve pods.

pod install

Confirmed by blog.cocoapods.org

Did this fix it?

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.lock

2Fix

Run pod update once, review the diff of Podfile.lock, and commit it.

pod update
git diff Podfile.lock

3Verify

A plain pod install now finishes without errors.

pod install

Confirmed by blog.cocoapods.org

Did this fix it?

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

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 fix

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.