CocoaPods could not find compatible versions for pod "React/Core"?

Viewed 586

Following the steps in the link doesn't help in integrating react native in existing project.

Link: https://reactnative.dev/docs/integration-with-existing-apps

Configuration

Mac OS X - 10.15.6 (19G2021)
XCode - 12.1 (12A7403)
React Native Cli - 2.0.1
React Native - 0.63.4

package.json

{
  "name": "MyReactNativeApp",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "start": "yarn react-native start"
  }
  "dependencies": {
    "react-native": "^0.63.4"
  }
}

Podfile

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

# Required for Swift apps
platform :ios, '11.0'
use_frameworks!

# The target name is most likely the name of your project.
target 'MyReactNativeApp' do
  
  # Your 'node_modules' directory is probably in the root of your project,
  # but if not, adjust the `:path` accordingly
  pod 'React', :path => '../MyReactNativeApp/node_modules/react-native', :subspecs => [
  'Core',
  'CxxBridge', # Include this for RN >= 0.47
  'DevSupport', # Include this to enable In-App Devmenu if RN >= 0.43
  'RCTText',
  'RCTNetwork',
  'RCTWebSocket', # needed for debugging
  # Add any other subspecs you want to use in your project
  ]
  # Explicitly include Yoga if you are using RN >= 0.42.0
  pod "Yoga", :path => "../MyReactNativeApp/node_modules/react-native/ReactCommon/yoga"
  
  # Third party deps podspec link
  pod 'DoubleConversion', :podspec => '../MyReactNativeApp/node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
  pod 'glog', :podspec => '../MyReactNativeApp/node_modules/react-native/third-party-podspecs/glog.podspec'
  pod 'Folly', :podspec => '../MyReactNativeApp/node_modules/react-native/third-party-podspecs/Folly.podspec'
  
end

When I run pod install. I get an error

[!] CocoaPods could not find compatible versions for pod "React/Core":

Screenshot:

enter image description here

I checked existing threads. Nothing works fine. I also did pod 'React' by removing everything else, result is

  1. It's deprecated
  2. It's not detected as Module. Module not found - I will separate Question for that.
1 Answers

Follow these steps. It might help.

  • Open your project in XCode.
  • Expand Pods file.
  • There should be Development Pods, expand it also.
  • Find React folder. There should be 2 folders: Pods and Support Files. Go to Pods folder.
  • This directory should contain React.podspec file, open it, find where is s.dependency "React/Core", and change to s.dependency "React-Core",.
Related