'Сocoapods trunk URL couldn't be downloaded

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?



Solution 1:[1]

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

Solution 2:[2]

I got it working by using below commands:

  1. pod repo remove trunk
    and then

  2. pod install or pod update

Solution 3:[3]

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

Solution 4:[4]

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!

Solution 5:[5]

Just try this in your terminal:

sudo gem install cocoapods

Solution 6:[6]

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.

Solution 7:[7]

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.

Solution 8:[8]

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

Solution 9:[9]

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

Solution 10:[10]

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/'

Solution 11:[11]

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

Solution 12:[12]

Fixed this by removing ~/.cocoapods again.

If above not work then try below solution

  1. Specify the source source as master in the podfile file:

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

  2. Execute pod repo remove trunk to remove the trunk source

Solution 13:[13]

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!

Solution 14:[14]

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

Solution 15:[15]

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.

Solution 16:[16]

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