找不到'jsireact/JSIExecutor.h'文件

IPS*_*IPS 9 xcode cocoapods react-native

我正在研究没有世博会的原生应用.我正在尝试使用react-native-video包.此外,我正在使用cocoapods在Xcode中运行项目.

这是我的pod文件:

# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'


target 'myprj' do
  # Uncomment the next line if you're using Swift or would like to use dynamic frameworks
  use_frameworks!
 # Pods for myprj
  # Your 'node_modules' directory is probably in the root of your project,
  # but if not, adjust the `:path` accordingly

 pod 'React', :path => '../node_modules/react-native', :subspecs => [
 'Core',
 'CxxBridge',
 'DevSupport'
 ]
 # Explicitly include Yoga if you are using RN >= 0.42.0
 pod 'yoga', :path => '../node_modules/react-native/ReactCommon/yoga'

 # Third party deps podspec link
 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 'react-native-video', :path => '../node_modules/react-native-video'


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

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

  end

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

end
Run Code Online (Sandbox Code Playgroud)

现在,当我尝试运行项目时,它给出了以下错误:

node_modules/react-native/React/CxxBridge/RCTCxxBridge.mm:37:9:致命错误:找不到'jsireact/JSIExecutor.h'文件

请建议我解决它,因为我试图搜索但没有找到任何解决方案.

请检查此屏幕截图.

在此输入图像描述

请找我的package.json

{
  "name": "myprj",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "start": "node node_modules/react-native/local-cli/cli.js start",
    "test": "jest"
  },
  "dependencies": {
    "immutability-helper": "^3.0.0",
    "prop-types": "^15.6.2",
    "react": "16.6.3",
    "react-native": "0.58.3",
    "react-native-deprecated-custom-components": "^0.1.2",
    "react-native-video": "^4.3.1"
  },
  "devDependencies": {
    "babel-core": "7.0.0-bridge.0",
    "babel-jest": "24.0.0",
    "jest": "24.0.0",
    "metro-react-native-babel-preset": "0.51.1",
    "react-test-renderer": "16.6.3"
  },
  "jest": {
    "preset": "react-native"
  }
}
Run Code Online (Sandbox Code Playgroud)

Jef*_*eff 9

问题在于react-native: "0.58.5"React Native子目录中HEADER SEARCH PATHSjsiexecutor分支master

资料来源:https: //github.com/facebook/react-native/pull/23274/files

临时修复:

  1. 打开"react-native": "0.58.3"发现React.podspec

  2. 更新node_modules/react-native/React.podspecHEADER_SEARCH_PATHSsubspec阅读:

  s.subspec "jsiexecutor" do |ss|
    ss.dependency             "React/cxxreact"
    ss.dependency             "React/jsi"
    ss.dependency             "Folly", folly_version
    ss.compiler_flags       = folly_compiler_flags
    ss.source_files         = "ReactCommon/jsiexecutor/jsireact/*.{cpp,h}"
    ss.private_header_files = "ReactCommon/jsiexecutor/jsireact/*.h"
    ss.header_dir           = "jsireact"
    ss.pod_target_xcconfig  = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\", \"$(PODS_TARGET_SRCROOT)/ReactCommon/jsiexecutor\"" }
  end
Run Code Online (Sandbox Code Playgroud)
  1. jsiexecutor