在`../ node_modules / React`中找不到`React-Core`的podspec。

时间:2020-04-23 13:54:50

标签: react-native podfile

首先,它没有重复。因为我有不同的问题。我将我的react Native版本升级到了'0.62.2'(希望我还没有升级)。我现在正在处理很多问题。这是我现在的问题,在React-Core中找不到../node_modules/React的podspec,我无法解决

可以看出,类似问题总是存在错误的路径。但是,即使我编写了正确的路径,它也会出现错误。另外,当我查看'../node_modules/react-native'时,我在这里看不到React-Core文件 [![在此处输入图片描述] [1]] [1] 我发现了类似的问题和解决方案。如下面的示例

  1. No podspec found for `React-Core` in `../node_modules/react-native/React`

  2. No podspec found for `React-Core` in `../node_modules/react-native`

pod安装

分析依赖性

DoubleConversion获取../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec的podspec

[!]在React-Core中找不到../node_modules/React的podspec

Podfile

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

target 'DGFonder' do
  pod 'React', :path => '../node_modules/react-native/'
  pod 'React-Core', :path => '../node_modules/React'
  pod 'React-DevSupport', :path => '../node_modules/react-native/React'
  pod 'React-fishhook', :path => '../node_modules/react-native/Libraries/fishhook'
  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'
  p
end

swift4 = ['Charts']

post_install do |installer|
  installer.pods_project.targets.each do |target|

    targets_to_ignore = %w(React yoga)
      
    if targets_to_ignore.include? target.name
      target.remove_from_project
    end

    target.build_configurations.each do |config|
      if swift4.include?(target.name)
        config.build_settings['SWIFT_VERSION'] = '4.1'
      end
    end
  end
end
```


  [1]: https://i.stack.imgur.com/NNLjD.png

2 个答案:

答案 0 :(得分:0)

React现在是node_modules中react-native的一部分。因此,您需要将React-Core吊舱更新为:

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

在指定的路径中注意react-native

答案 1 :(得分:0)

我遇到了同样的问题,这是因为 node_modules 只需执行以下步骤

  1. 删除所有 node_modules
  2. 运行 npm i 并检查是否存在任何漏洞,然后执行 npm 审计修复
  3. 进入ios文件夹
  4. 运行 pod install
  5. 它会起作用