Сocoapods trunk URL couldn't be downloaded

99.9k Views Asked by At

I am getting this error when I try to pod repo update and pod install

CDN: trunk URL couldn't be downloaded: https://cdn.cocoapods.org/deprecated_podspecs.txt, error: Failed to open TCP connection to cdn.cocoapods.org:443 (No route to host - connect(2) for "cdn.cocoapods.org" port 443)

Does somebody know how to fix this problem?

24

There are 24 best solutions below

4
Nike Kov On BEST ANSWER

It seems that it's a cdn problem because when i use proxy the link https://cdn.cocoapods.org/all_pods_versions_e_2_1.txt is opened and when not it return error.

What i did: gem uninstall cocoapods gem cleanup rvm osx-ssl-certs update all

That didn't help.

Then i went to Chrome and opened https://cdn.cocoapods.org/all_pods_versions_e_2_1.txt it was an error. Then i cleared cache but it didn't help. After switching to proxy and returning back it started to work.

Resume: Turn on and switch off the VPN.

Also try to pod cache clean --all and pod setup by @NightWatcher

2
Eduard On

Just try this in your terminal:

sudo gem install cocoapods
2
Eugene On

I fixed it by this solution Add this to your Podfile:

source 'https://cdn.cocoapods.org/'

Afterwards, run the following command to remove it from your managed repo list (in console):

pod repo remove master

Cheers!

8
ankitjaiswal On

I got it working by using below commands:

  1. pod repo remove trunk
    and then

  2. pod install or pod update

2
Naval Hasan On

I spend hours by uninstalling and reinstalling pods, Connecting and disconnecting wifi, and trying out different solutions I could find from the internet. And nothing worked. Finally I decided to restart my Macbook and the problem solved. So before trying the solutions given above, I would strongly recommend you to try restarting your system.

0
Zgpeace On

Step one. Remove trunk & master

pod repo remove trunk
pod repo remove master

Step two. Add source in podfile.

source 'https://github.com/CocoaPods/Specs.git'
source 'https://cdn.cocoapods.org/'

Step three. Run pod update. Solve my problem.

pod update --verbose
0
ViruMax On

Tried many solutions from here and there but what worked in my case is:

gem uninstall cocoapods 
gem cleanup
sudo gem install cocoapods -n /usr/local/bin

Hope it works for you!

3
gcharita On

Based on this github comment: whenever cocoapods CDN not working due to DNS issues, try adding directly the url that cdn.cocoapods.org redirects to, as a source in the top level of your Podfile:

source 'https://cocoapods-cdn.netlify.app/'
1
Kate M On

Several of these solutions didn't work for me but it was successful with updating the pods once I disconnected from AnyConnect VPN.

1
Pradeep Reddy Kypa On

Remove Podfile.lock and try re-installing the Pods again (pod install). This worked for me.

1
Aleksey Potapov On

For those, who faced with the following:

[!] CDN: trunk Repo update failed - 1 error(s): CDN: trunk URL couldn't be downloaded: https://...podspec.json Response: 429 429: Too Many Requests

You should remove Podfile.lock, Pod folder and reconnect to your VPN (if any) then run

pod install --repo-update

0
Glymaxus On

On all of those comments; nothing worked for me So i found this and it worked perfectly for me :

pod cache clean --all

pod setup

2
SoftDesigner On

After checking all the answers and using VPN just to update pods, I've tried:

pod repo remove trunk
pod repo remove master
sudo rm -rf ~/.cocoapods/repos
pod update

I'm not specifying this BTW:
source 'https://cdn.cocoapods.org/'

And all worked.

1
M. Waris On

i have tried all above options but nothing fixed my issue. i just switched my internet connection to other service provider and then try pod install and trunk url issue was no more there. so try to switch internet connection if facing trunk url issue.

1
Nitish On

I had the same issue. I followed below steps and it works.

I suggest to restart the system before following below instructions.

Delete Podfile.lock add source 'https://github.com/CocoaPods/Specs.git' line in Podfile

Then run below commands

pod repo remove trunk
sudo gem install cocoapods-deintegrate cocoapods-clean
pod deintegrate
pod cache clean --all
sudo gem uninstall cocoapods
sudo gem install cocoapods
pod install or pod update
0
amishra On

Faced the same issue and tried all the answers suggested above. But, the real issue seemed to be with not being able to access the Git repo for Cocoapods: ‘error: cannot open .git/FETCH_HEAD: Permission denied

Executing sudo chown -R $USER: . at /Users/user_name/.cocoapods/repos/cocoapods fixed the issue

1
ISMOILJON Xolmatov On

it's up to proxy servise you've to do is all first open up your proxy and set it up into your country or turn it off temporarely and clean your xcode build folder and try again pod install ro pod update I hope that'll work

0
Gene M On

Someone might be checking on this in 2023 so here's what I did (in a React Native project)

$ cd ios/
$ pod repo remove trunk
$ pod deintegrate
$ pod cache clean --all
$ pod install
0
Mohamed Hassan On

just remove Pods folder and Podfile.lock

add

source 'https://github.com/CocoaPods/Specs.git'

to the top Podfile

then clean cache pod cache clean --all

finally update and install pod pod install --repo-update

0
Hosam Abdelnaser On

If all the answers did not help, try these steps:

  1. Make sure you're in ios folder and list all available pod repos

    pod repo list

  2. Iterate over the list and delete all of them

    pod repo remove [repo_name]

  3. In any folder on your local machine, clone Cocoapods Github repo

    git clone "https://github.com/CocoaPods/Specs.git"

  4. At the top of your podfile, reference only this local repo

    source '/Users/hossamabdelnaser/Specs' # This depends on where you cloned the repo

  5. Make sure you're in ios folder and install pods

    pod install

Hope that helps

0
Moataz Fouuad On

I was experiencing this issue, when I used VPN every thing was fine!

0
Mohamed Gadallah On

Managed to solve this problem by using Cloduflare's WARP which is a proxy server

Downloaded from here:

https://1.1.1.1/

0
Medhi On

If you stuck with this annoying error, here all the solutions in order.

1: Try update cocoapods

sudo gem install cocoapods

Then pod update / install.

2: Remove cocoapods cache

pod cache clean --all
pod setup

Then pod update / install.

3: Remove cocoapods cache

pod repo remove trunk
pod repo remove master

Add source in your podfile:

source 'https://github.com/CocoaPods/Specs.git'
source 'https://cdn.cocoapods.org/'

Then pod update / install.

4: Uninstall / reinstall Cocoapods

gem uninstall cocoapods
brew install cocoapods

Then pod update / install.

5: Try reboot Mac

The last chance... Then pod update / install.

0
ims On

This worked for me, on Apple Mac with M1:

gem uninstall cocoapods
arch -x86_64 brew install cocoapods
arch -x86_64 brew reinstall cocoapods
brew link --overwrite cocoapods