Ios 在“../node\u modules/React native/React”中未找到“React Core”的podspec`

Ios 在“../node\u modules/React native/React”中未找到“React Core”的podspec`,ios,react-native,cocoapods,Ios,React Native,Cocoapods,我用的是React Native。我在尝试上传播客时遇到了这个问题。我已经成功安装了node_模块,但是我遇到了这个问题。有什么问题?如果我们删除package-lock.json和node_modules文件夹,我将重新安装npm。但我在安装吊舱时遇到了这个问题 platform :ios, '9.0' require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules' targ

我用的是React Native。我在尝试上传播客时遇到了这个问题。我已经成功安装了node_模块,但是我遇到了这个问题。有什么问题?如果我们删除package-lock.json和node_modules文件夹,我将重新安装npm。但我在安装吊舱时遇到了这个问题

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

target '...' do

  # use_frameworks!

  pod 'React', :path => '../node_modules/react-native/'
  pod 'React-Core', :path => '../node_modules/react-native/React'
  pod 'React-DevSupport', :path => '../node_modules/react-native/React'
  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-RCTWebSocket', :path => '../node_modules/react-native/Libraries/WebSocket'
  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 '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'

  # Required by RNFirebase
  pod 'Firebase/Core', '~> 6.8.1'

  # [OPTIONAL PODS] - comment out pods for firebase products you won't be using.
  # pod 'Firebase/AdMob', '~> 6.8.1'
  pod 'Firebase/Auth', '~> 6.8.1'
  pod 'Firebase/Database', '~> 6.8.1'
  pod 'Firebase/Functions', '~> 6.8.1'
  pod 'Firebase/DynamicLinks', '~> 6.8.1'
  pod 'Firebase/Firestore', '~> 6.8.1'
  pod 'Firebase/Messaging', '~> 6.8.1'
  pod 'Firebase/RemoteConfig', '~> 6.8.1'
  pod 'Firebase/Storage', '~> 6.8.1'
  pod 'Firebase/Performance', '~> 6.8.1'
  pod 'Fabric', '~> 1.10.2'
  pod 'Crashlytics', '~> 3.14.0'


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

  use_native_modules!

end

target '...-tvOS' do
  # Uncomment the next line if you're using Swift or would like to use dynamic frameworks
  # use_frameworks!

  # Pods for ..-tvOS

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

end
Podspec已从

../node_modules/react-native/React

所以,更新线路

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

请在此处检查,具体取决于您的本地版本

您应该使用
React Native upgrade
升级React Native,但在不使用此工具(有时也使用此工具)升级时,请检查React Native版本所需的所有pod是否都在Podfile中

检查Podfile的一个好工具是。例如,如果将RN从0.60.6升级到0.61.4,则Podfile中的RN pod依赖项将显著不同:

#响应本机pod依赖项
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'RCTTypeSaffety',: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”,路径=>'../node_modules/React native/'
pod“React RCTActionSheet”,:path=>“../node_modules/React native/Libraries/ActionSheetIOS”
pod“React RCTAnimation”,路径=>“../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/React Common/jsi'
pod'React-jsiexecutor',:path=>'../node_modules/React-native/React-Common/jsiexecutor'
pod“React-jsinspector',:path=>“../node_modules/React-native/React-Common/jsinspector”
pod'ReactCommon/jscallinvoker',:path=>“./node_modules/react native/ReactCommon”
pod“ReactCommon/turbomodule/core”,路径=>“./node_模块/ReactNative/ReactCommon”
pod“Yoga”,路径=>“../node_模块/react native/react common/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'

将Podspec移至时发生此错误

../node_modules/react-native
为了解决这个问题,请在pod文件中粘贴以下代码。在你的目标之内

 # Pods for RnDiffApp
  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'

  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'
我参考了


确保不要删除Podfile中现有添加的模块。

嘿,伙计们,这个更新的pod文件保存了我的一天

# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

target 'Native_iOS_App' do
use_frameworks!
config = use_native_modules!
use_react_native!(:path => config["../node_modules/react-native"])

end
我在跑步

pod install
在ios目录中,当我遇到不同依赖项的此错误时。我忘了跑

npm install

运行此命令后,请输入pod INSATTL。我成功地运行了该项目。

Eric的回答可能是问题的根本原因,使用了以前/不同版本的RN的RN Podfile布局。当从0.62移动到0.63时,我得到了相同的错误

对于从0.62到0.63的用户,显示Eric引用的非常详细的RN Podfile样板现在更加简洁(参见Som的回复-尽管还有一些变化)


就我个人而言,我用0.63创建了一个新的react原生项目,并将其与我的项目进行了比较。如果我知道的话,我会使用它。

错误代码:[!]CocoaPods找不到pod“React/jsinspector”的兼容版本:在Podfile:React/jsinspector(来自
。/node\u modules/React native/
)中,没有一个规范源包含满足依赖关系的规范:
React/jsinspector(来自
。/node_modules/react native/
。您有:*过期的源repo,您可以使用
pod repo update
pod install--repo update
*错误键入名称或版本。*未将承载Podspec的源repo添加到您的pod文件。
在“../node\u modules/React native/”中未找到“React DevSupport”的Podspecios/Podfile
pod'React-DevSupport',第8行:path=>'../node\u modules/React-native/'
如果进一步出现“未找到podspec”错误,您可能需要查看RN Upgrade Helper应用程序,以查看您正在使用的版本在Podfile文件中的差异。这对我有帮助。对于React-native 0.62,请替换pod'React-Common/jscallinvoker',:path=>“./node_modules/react native/ReactCommon”和pod'ReactCommon/callinvoker',:path=>”./node_modules/react native/ReactCommon“参考:
pod install
npm install