react-native: Unable to add a source with url `https://cdn.cocoapods.org/` named `trunk`

Description

Init ios project failed on pod install

React Native version:

“react-native”: “0.63.2”

Steps To Reproduce

Provide a detailed list of steps that reproduce the issue.

1. react-native init AwesomeProject error Error: Failed to install CocoaPods dependencies for iOS project, which is required by this template. Please try again manually: “cd ./AwesomeProject/ios && pod install”. cd ./AwesomeProject/ios && pod install

2.

Stanimirs-Mac-mini:ios sytolk$ `pod install`
Analyzing dependencies
Fetching podspec for `DoubleConversion` from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`
Fetching podspec for `Folly` from `../node_modules/react-native/third-party-podspecs/Folly.podspec`
Fetching podspec for `glog` from `../node_modules/react-native/third-party-podspecs/glog.podspec`
Cloning spec repo `trunk` from `https://cdn.cocoapods.org/`
[!] Unable to add a source with url `https://cdn.cocoapods.org/` named `trunk`.
You can try adding it manually in `/Users/sytolk/.cocoapods/repos` or via `pod repo add`.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 23
  • Comments: 39 (2 by maintainers)

Most upvoted comments

99% there’s a CDN issue. The temporary workaround is to insert into the podfile this:

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

Once the CDN issue is solved just leave : source 'https://cdn.cocoapods.org/'

I have the same problem. Tried with 1.8 and with the new 1.9.3 but I can’t install any pods 😦

this issue is already solved CocoaPods/CocoaPods#10078

This is not fixed

This is not a react native specific issue, but is due to CocoaPods CDN being down

99% there’s a CDN issue. The temporary workaround is to insert into the podfile this:

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

Once the CDN issue is solved just leave : source 'https://cdn.cocoapods.org/'

Worked for me thank you - cloning the repo also took upwards of 10+ minutes for me.

I have add: pod repo add-cdn trunk 'https://cdn.cocoapods.org' now its have:

Stanimirs-Mac-mini:ios sytolk$ pod repo list
/Users/sytolk/.rvm/rubies/ruby-2.7.0/lib/ruby/gems/2.7.0/gems/cocoapods-core-1.9.3/lib/cocoapods-core/cdn_source.rb:342: warning: URI.escape is obsolete
[!] CDN: trunk URL couldn't be downloaded: https://cdn.cocoapods.org/CocoaPods-version.yml Response: 500 
<html>
<head>
<title>Fastly error: unknown domain cdn.cocoapods.org</title>
</head>
<body>
<p>Fastly error: unknown domain: cdn.cocoapods.org. Please check that this domain has been added to a service.</p>
<p>Details: cache-fra19156-FRA</p></body></html>

@DanielZanchi

platform :ios, '9.0'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

def add_flipper_pods!(versions = {})
  versions['Flipper'] ||= '~> 0.33.1'
  versions['DoubleConversion'] ||= '1.1.7'
  versions['Flipper-Folly'] ||= '~> 2.1'
  versions['Flipper-Glog'] ||= '0.3.6'
  versions['Flipper-PeerTalk'] ||= '~> 0.0.4'
  versions['Flipper-RSocket'] ||= '~> 1.0'

  pod 'FlipperKit', versions['Flipper'], :configuration => 'Debug'
  pod 'FlipperKit/FlipperKitLayoutPlugin', versions['Flipper'], :configuration => 'Debug'
  pod 'FlipperKit/SKIOSNetworkPlugin', versions['Flipper'], :configuration => 'Debug'
  pod 'FlipperKit/FlipperKitUserDefaultsPlugin', versions['Flipper'], :configuration => 'Debug'
  pod 'FlipperKit/FlipperKitReactPlugin', versions['Flipper'], :configuration => 'Debug'

  # List all transitive dependencies for FlipperKit pods
  # to avoid them being linked in Release builds
  pod 'Flipper', versions['Flipper'], :configuration => 'Debug'
  pod 'Flipper-DoubleConversion', versions['DoubleConversion'], :configuration => 'Debug'
  pod 'Flipper-Folly', versions['Flipper-Folly'], :configuration => 'Debug'
  pod 'Flipper-Glog', versions['Flipper-Glog'], :configuration => 'Debug'
  pod 'Flipper-PeerTalk', versions['Flipper-PeerTalk'], :configuration => 'Debug'
  pod 'Flipper-RSocket', versions['Flipper-RSocket'], :configuration => 'Debug'
  pod 'FlipperKit/Core', versions['Flipper'], :configuration => 'Debug'
  pod 'FlipperKit/CppBridge', versions['Flipper'], :configuration => 'Debug'
  pod 'FlipperKit/FBCxxFollyDynamicConvert', versions['Flipper'], :configuration => 'Debug'
  pod 'FlipperKit/FBDefines', versions['Flipper'], :configuration => 'Debug'
  pod 'FlipperKit/FKPortForwarding', versions['Flipper'], :configuration => 'Debug'
  pod 'FlipperKit/FlipperKitHighlightOverlay', versions['Flipper'], :configuration => 'Debug'
  pod 'FlipperKit/FlipperKitLayoutTextSearchable', versions['Flipper'], :configuration => 'Debug'
  pod 'FlipperKit/FlipperKitNetworkPlugin', versions['Flipper'], :configuration => 'Debug'
end

# Post Install processing for Flipper
def flipper_post_install(installer)
  installer.pods_project.targets.each do |target|
    if target.name == 'YogaKit'
      target.build_configurations.each do |config|
        config.build_settings['SWIFT_VERSION'] = '4.1'
      end
    end
  end
end

target 'AProj' do
  # Pods for AProj
  pod 'FBLazyVector', :path => "../node_modules/react-native/Libraries/FBLazyVector"
  pod 'FBReactNativeSpec', :path => "../node_modules/react-native/Libraries/FBReactNativeSpec"
  pod 'RCTRequired', :path => "../node_modules/react-native/Libraries/RCTRequired"
  pod 'RCTTypeSafety', :path => "../node_modules/react-native/Libraries/TypeSafety"
  pod 'React', :path => '../node_modules/react-native/'
  pod 'React-Core', :path => '../node_modules/react-native/'
  pod 'React-CoreModules', :path => '../node_modules/react-native/React/CoreModules'
  pod 'React-Core/DevSupport', :path => '../node_modules/react-native/'
  pod 'React-RCTActionSheet', :path => '../node_modules/react-native/Libraries/ActionSheetIOS'
  pod 'React-RCTAnimation', :path => '../node_modules/react-native/Libraries/NativeAnimation'
  pod 'React-RCTBlob', :path => '../node_modules/react-native/Libraries/Blob'
  pod 'React-RCTImage', :path => '../node_modules/react-native/Libraries/Image'
  pod 'React-RCTLinking', :path => '../node_modules/react-native/Libraries/LinkingIOS'
  pod 'React-RCTNetwork', :path => '../node_modules/react-native/Libraries/Network'
  pod 'React-RCTSettings', :path => '../node_modules/react-native/Libraries/Settings'
  pod 'React-RCTText', :path => '../node_modules/react-native/Libraries/Text'
  pod 'React-RCTVibration', :path => '../node_modules/react-native/Libraries/Vibration'
  pod 'React-Core/RCTWebSocket', :path => '../node_modules/react-native/'

  pod 'React-cxxreact', :path => '../node_modules/react-native/ReactCommon/cxxreact'
  pod 'React-jsi', :path => '../node_modules/react-native/ReactCommon/jsi'
  pod 'React-jsiexecutor', :path => '../node_modules/react-native/ReactCommon/jsiexecutor'
  pod 'React-jsinspector', :path => '../node_modules/react-native/ReactCommon/jsinspector'
  pod 'ReactCommon/callinvoker', :path => "../node_modules/react-native/ReactCommon"
  pod 'ReactCommon/turbomodule/core', :path => "../node_modules/react-native/ReactCommon"
  pod 'Yoga', :path => '../node_modules/react-native/ReactCommon/yoga', :modular_headers => true

  pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
  pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec'
  pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'

  target 'AProjTests' do
    inherit! :complete
    # Pods for testing
  end

  use_native_modules!

  # Enables Flipper.
  #
  # Note that if you have use_frameworks! enabled, Flipper will not work and
  # you should disable these next few lines.
  add_flipper_pods!
  post_install do |installer|
    flipper_post_install(installer)
  end
end

target 'AProj-tvOS' do
  # Pods for AProj-tvOS

  target 'AProj-tvOSTests' do
    inherit! :search_paths
    # Pods for testing
  end
end

I can’t see where you added that but. add source 'https://github.com/CocoaPods/Specs.git' after platform :ios, '9.0'

99% there’s a CDN issue. The temporary workaround is to insert into the podfile this:

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

Once the CDN issue is solved just leave : source 'https://cdn.cocoapods.org/'

Worked for me thank you - cloning the repo also took upwards of 10+ minutes for me.

Also working for me as of Dec 2020 on a Windows 10 box.

I have a faster connection and it took 10 minutes. Don’t know what to say

Same for me!

@DanielZanchi I did:

anton.titkov@antimac ios % cat Podfile
platform :ios, '9.0'
source 'https://github.com/CocoaPods/Specs.git'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
...

The same result:

anton.titkov@antimac ios % pod install
Auto-linking React Native modules for target `Leviosa`: RNAWSCognito, RNCAsyncStorage, RNCClipboard, RNCMaskedView, RNDeviceInfo, RNGestureHandler, RNReanimated, RNScreens, react-native-netinfo, react-native-safe-area-context, react-native-simple-crypto, react-native-slider, react-native-tcp-socket, react-native-udp, react-native-uuid-generator, and react-native-viewpager
Analyzing dependencies
Fetching podspec for `DoubleConversion` from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`
Fetching podspec for `Folly` from `../node_modules/react-native/third-party-podspecs/Folly.podspec`
Fetching podspec for `glog` from `../node_modules/react-native/third-party-podspecs/glog.podspec`
[!] CDN: trunk URL couldn't be downloaded: https://cdn.cocoapods.org/CocoaPods-version.yml Response: 500 
<html>
<head>
<title>Fastly error: unknown domain cdn.cocoapods.org</title>
</head>
<body>
<p>Fastly error: unknown domain: cdn.cocoapods.org. Please check that this domain has been added to a service.</p>
<p>Details: cache-hhn4075-HHN</p></body></html>

Pod 1.9.3 - maybe this is my trouble?

99% there’s a CDN issue. The temporary workaround is to insert into the podfile this:

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

Once the CDN issue is solved just leave : source 'https://cdn.cocoapods.org/'

Sorry, @DanielZanchi - what Podfile to fix?

I added source 'https://github.com/CocoaPods/Specs.git' to ios/Podfile - doesn’t help

in case adding source 'https://github.com/CocoaPods/Specs.git' doesnt work for you, try to erase trunk from cocoapods repos rm -rf ~/.cocoapods/repos/trunk

I am getting the same issue:

[!] CDN: trunk URL couldn't be downloaded: https://cdn.cocoapods.org/CocoaPods-version.yml Response: 500
<html>
<head>
<title>Fastly error: unknown domain cdn.cocoapods.org</title>
</head>
<body>
<p>Fastly error: unknown domain: cdn.cocoapods.org. Please check that this domain has been added to a service.</p>
<p>Details: cache-hhn4061-HHN</p></body></html>
cocoapods-1.9.3
"react-native": "0.62.2"