🚨 Persistent Error, Pod install fails: “CDN: trunk URL couldn’t be downloaded” in React Native 0.74.0

Tokhirjon
2 min readMay 3, 2024

--

🎯 Introduction

Navigating the ups and downs of mobile app development with React Native can be thrilling — until you run into a sudden roadblock. Recently, when updating to React Native version 0.74.0, I encountered a frustrating error that halted my progress: the pod install error, “Pod install fails: CDN: trunk URL couldn’t be downloaded or SSL peer certificate or SSH remote key was not OK ”. If this sounds all too familiar, you’re in the right place. I’ve found a way through this challenge and am excited to share it with you.

🔍 The Problem Unveiled

The error surfaced unexpectedly while performing a routine pod install command. Here's the core of the issue:

Pod install fails: "CDN: trunk URL couldn't be downloaded"

This is more than a minor nuisance; it’s a common stumbling block that can significantly delay your project’s timeline, impacting your development workflow.

🛠️ The Fix: A Step-by-Step Guide

Through diligent research and testing various fixes found in GitHub discussions, I developed a straightforward and effective solution:

  • Step 1: 👉 At the very top of your Podfile, insert:
source 'https://github.com/CocoaPods/Specs.git'
  • This step shifts the source of your pods to a reliable GitHub repository, moving away from the often problematic default CDN.
  • Step 2: 🗑️ Delete the Podfile.lock file in your project. This file might contain outdated or incorrect dependency information that could be contributing to the issue.
  • Step 3: 🔄 Run the command
pod repo remove trunk

This clears any potentially corrupted cached data from the trunk repository.

Step 4: 🚀 Initiate:

pod install

This should successfully install the dependencies without any CDN-related errors, clearing the way for your project’s progress.

🧐 Why This Works

Changing the source to a direct GitHub link avoids problems associated with CocoaPods’ default CDN. By removing the lock file and clearing the repo cache, your build is refreshed with the latest and most accurate dependency data.

🔗 Alternative Solutions and Additional Tips

If you encounter further issues, consider updating CocoaPods itself or examining your network configurations. Often, straightforward fixes can resolve complex problems.

📢 Conclusion and Call to Action

This guide aims to alleviate some of the frustration associated with this common issue. Try out these steps and share your results in the comments. Your feedback could help refine this solution further!

Don’t hesitate to hit the clap button if this post was helpful, and follow me here on Medium for more insights into navigating the complexities of mobile development with React Native.

--

--

Tokhirjon
Tokhirjon

Written by Tokhirjon

🌐 Front-End Dev & 🍏 Swift Fan | UI/UX & SwiftUI | Tech Insights & Stories 📚

No responses yet