11

I have this react native project that im working with multiple computers, in my MacBook everything works fine, when I run "pod install" after running "npm install" the pods project is created successfully, in the other hand when I do the same in my desktop I get this following error:

enter image description here

Ive tried installing pods for other projects and everything works fine, the problem is with this project in particular.

UPDATAE:

Thanks for your comments, for you to know:

after running:

pod repo remove trunk
pod install

This is what I get:

enter image description here

This is my package.json:

{
  "name": "aksystems",
  "version": "3.9.8",
  "description": "",
  "author": "",
  "private": true,
  "scripts": {
    "start": "react-native start",
    "test": "jest",
    "lint": "eslint .",
    "ios": "cd ios/ && rm -rf Pods/ && rm -rf Podfile.lock && pod install && cd ../ && react-native run-ios",
    "android": "cd android/ && ./gradlew clean && cd ../ && react-native run-android",
    "build:ios": "node node_modules/react-native/local-cli/cli.js bundle --entry-file='index.js' --bundle-output='./ios/mstore/main.jsbundle' --dev=false --platform='ios' --assets-dest='./ios'",
    "setup": "./scripts/setup.sh",
    "setup:android": "./scripts/setup_android.sh",
    "reset": "./scripts/reset.sh",
    "postinstall": "patch-package && npx jetify"
  },
  "dependencies": {
    "@babel/plugin-proposal-class-properties": "^7.5.5",
    "@babel/plugin-proposal-decorators": "^7.4.4",
    "@invertase/react-native-apple-authentication": "^0.1.1",
    "@react-native-community/async-storage": "^1.5.1",
    "@react-native-community/netinfo": "5.0.1",
    "@react-native-community/viewpager": "^3.3.0",
    "@react-native-firebase/app": "^6.0.4",
    "@react-native-firebase/auth": "^6.0.4",
    "api-ecommerce": "0.0.34",
    "base-64": "^0.1.0",
    "currency-formatter": "^1.5.4",
    "deprecated-react-native-listview": "0.0.6",
    "firebase": "^7.9.1",
    "firebase-admin": "^8.9.2",
    "glob": "^7.1.6",
    "html-entities": "^1.2.1",
    "jetifier": "^1.6.3",
    "lodash": "^4.17.15",
    "moment": "^2.24.0",
    "native-base": "^2.13.8",
    "oauth-1.0a": "^2.2.6",
    "patch-package": "^6.1.2",
    "postinstall-postinstall": "^2.0.0",
    "react": "16.9.0",
    "react-native": "0.61.5",
    "react-native-admob": "^2.0.0-beta.6",
    "react-native-animatable": "^1.3.2",
    "react-native-app-intro-slider": "^3.0.0",
    "react-native-apple-authentication": "https://github.com/ton44079/react-native-apple-authentication",
    "react-native-camera": "git+https://git@github.com/react-native-community/react-native-camera.git",
    "react-native-clean-form": "^0.5.0",
    "react-native-collapsible": "^1.4.0",
    "react-native-country-picker-modal": "^1.10.0",
    "react-native-credit-card-input": "^0.4.1",
    "react-native-date-picker": "^2.7.7",
    "react-native-drawer": "^2.5.1",
    "react-native-facebook-account-kit": "^2.1.0",
    "react-native-fbsdk": "^1.1.1",
    "react-native-fluid-slider": "^1.0.2",
    "react-native-gesture-handler": "^1.6.0",
    "react-native-image-picker": "^2.3.1",
    "react-native-image-zoom-viewer": "^2.2.26",
    "react-native-keyboard-aware-scroll-view": "0.9.1",
    "react-native-linear-gradient": "^2.5.5",
    "react-native-localization": "^2.1.4",
    "react-native-masked-text": "^1.12.4",
    "react-native-modalbox": "2.0.0",
    "react-native-onesignal": "3.5.0",
    "react-native-paper": "3.4.0",
    "react-native-picker-select": "^6.3.3",
    "react-native-radio-buttons": "^1.0.0",
    "react-native-reanimated": "^1.7.0",
    "react-native-render-html": "^4.1.2",
    "react-native-restart": "^0.0.13",
    "react-native-screens": "^2.0.0-alpha.22",
    "react-native-scrollable-tab-view": "1.0.0",
    "react-native-snap-carousel": "^3.8.0",
    "react-native-star-rating": "^1.1.0",
    "react-native-store-rating": "^1.0.1",
    "react-native-swipe-list-view": "^2.0.0",
    "react-native-swiper": "^1.6.0-nightly.5",
    "react-native-tab-view": "^2.13.0",
    "react-native-vector-icons": "^6.6.0",
    "react-native-video": "^5.0.2",
    "react-native-webview": "8.0.1",
    "react-navigation": "4.0.10",
    "react-navigation-stack": "^1.10.3",
    "react-navigation-tabs": "^2.6.2",
    "react-redux": "7.1.0",
    "redux": "4.0.5",
    "redux-actions": "^2.6.5",
    "redux-persist": "5.10.0",
    "redux-thunk": "^2.3.0",
    "reselect": "^4.0.0",
    "tcomb-form-native": "^0.6.20",
    "tipsi-stripe": "^7.5.1",
    "urijs": "^1.19.1",
    "url": "^0.11.0",
    "url-parse": "^1.4.7",
    "util": "^0.12.1",
    "uuid": "^3.3.2",
    "validate.js": "^0.13.1",
    "wpapi": "^1.2.1"
  },
  "devDependencies": {
    "@babel/core": "7.6.2",
    "@babel/runtime": "7.6.2",
    "@react-native-community/eslint-config": "^0.0.5",
    "babel-jest": "24.9.0",
    "babel-plugin-transform-remove-console": "^6.9.4",
    "eslint": "6.5.1",
    "eslint-config-airbnb": "^18.0.1",
    "eslint-plugin-import": "^2.19.1",
    "eslint-plugin-jsx-a11y": "^6.2.3",
    "eslint-plugin-react-hooks": "^2.3.0",
    "jest": "24.9.0",
    "metro-react-native-babel-preset": "0.57.0",
    "react-test-renderer": "16.10.2",
    "reactotron-react-native": "4.0.2",
    "reactotron-redux": "3.1.2"
  },
  "jest": {
    "preset": "react-native",
    "setupFiles": [
      "./node_modules/react-native-gesture-handler/jestSetup.js"
    ]
  }
}

And podfile:

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

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

target 'aksystems' do
  # Pods for mstore
  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/jscallinvoker', :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'

  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'

  pod 'Google-Mobile-Ads-SDK'

  pod 'react-native-date-picker', :path => '../node_modules/react-native-date-picker'

  pod 'react-native-image-picker', :path => '../node_modules/react-native-image-picker'

  pod 'Stripe', '~> 14.0.0'

  pod 'tipsi-stripe', :path => '../node_modules/tipsi-stripe'

  pod 'react-native-onesignal', :path => '../node_modules/react-native-onesignal'

  target 'aksystemsTests' do
    inherit! :search_paths
    # Pods for testing
  end

  use_native_modules!
end

target 'OneSignalNotificationServiceExtension' do
  pod 'OneSignal', '>= 2.9.3', '< 3.0'
end

As you said, Ive seen in various SO questions and GitHub posts that might be a network issue but as I told you another Pod projects work pretty well, the pods versions are the same (last) and both machines are running over the same network.

ZYiOS
  • 5,204
  • 3
  • 39
  • 45
Karlo A. López
  • 2,548
  • 3
  • 29
  • 56
  • Do you have the latest Cocoapods version on both machines? Can you access [this file](https://cdn.cocoapods.org/Specs/e/2/1/FirebaseAnalytics/6.3.1/FirebaseAnalytics.podspec.json) from that machine? That sounds like a network issue. Also why there cocoapods is trying to fetch both `6.3.1` and `6.4.0` versions of `FirebaseAnalytics`? Please add the `Podfile` and the `package.json` contents to your question. – Christos Lytras Apr 18 '20 at 06:04
  • Thanks @ChristosLytras , added. – Karlo A. López Apr 18 '20 at 21:44
  • You can check my answer here [Сocoapods trunk URL couldn't be downloaded](https://stackoverflow.com/questions/58409725/%D0%A1ocoapods-trunk-url-couldnt-be-downloaded/59943058?noredirect=1#comment111121689_59943058) – ankitjaiswal Jul 11 '20 at 18:25

6 Answers6

23

You could try update the repos because it might not contain what you want. More info

pod repo update && pod install

If that fails, an example of the usage of pod 'Google-Mobile-Ads-SDK' adds a source explicitly,

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

OLD Answer:

Have you tried pod repo remove trunk; pod install as taken from this SO question. It would be useful if you shared your Podfile.

This removes a repo called `trunk' from cocoapods, then re-adds it.

Here is a gist of my Podfile, which also uses Firebase.

Ben Butterworth
  • 22,056
  • 10
  • 114
  • 167
13

Thank you all for the support, after multiple efforts of solving this, I found the solution was related to my network making IPV6 requests instead of IPV4, I don't filly understand this but this is how I solved:

System Preferences > Network > Advanced > TCP/IP > Configure IPv6: Link-local only

Source

Karlo A. López
  • 2,548
  • 3
  • 29
  • 56
3

CocoaPods 1.8.x offers the ability to use either Git or CDN (default).

You can always fallback to the previous git based implementation by adding to your Podfile:

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

Based on your last error log, i think this can be useful.

Maycon Mesquita
  • 4,470
  • 2
  • 21
  • 29
1

after trying many times it was fixed by : adding this to the top of the podfile ↙️

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

then do this:

pod repo remove trunk
pod install

refrence ✅: https://github.com/CocoaPods/CocoaPods/issues/9085

0

I came across the exact same problem. Turns out I compiled a problematic version of curl library from source in my operation system with make install. This libcurl binary is missing the ability to request https URLs.

So I just make uninstall this libcurl and fallback to system's libcurl and everything works fine again.

Pride Chung
  • 573
  • 7
  • 20
0
gem uninstall cocoapods
brew install cocoapods
Adriaan
  • 17,741
  • 7
  • 42
  • 75
  • 1
    Please read [answer] and [edit] your answer to contain an explanation as to why this code would actually solve the problem at hand. Always remember that you're not only solving the problem, but are also educating the OP and any future readers of this post. – Adriaan Mar 09 '23 at 12:29