xcode - 'jsireact/JSIExecutor.h' 文件未找到

标签 xcode react-native cocoapods

我正在开发没有 Expo 的本地应用程序。我正在尝试使用 react-native-video 包。我也在 Xcode 中使用 运行项目 cocoa 足类 .

这是我的 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

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

node_modules/react-native/React/CxxBridge/RCTCxxBridge.mm:37:9: fatal error :找不到“jsireact/JSIExecutor.h”文件

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

请同时检查此屏幕截图。

enter image description here

请找到我的 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"
  }
}

最佳答案

更新 : 这已在 react-native: "0.58.5" 中解决和更大。

问题在于 HEADER SEARCH PATHSjsiexecutor 的 React Native 子规范中在 master "react-native": "0.58.3"的分公司

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

临时修复:

  • 打开React.podspec发现于 node_modules/react-native/React.podspec
  • 更新 HEADER_SEARCH_PATHSjsiexecutor要阅读的子规范:
  •   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
    
  • 运行pod update
  • 关于xcode - 'jsireact/JSIExecutor.h' 文件未找到,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54460885/

    相关文章:

    react-native - 无法从 Assets 'index.android.bundle' 加载脚本。

    ios - Xcode 7 - 尝试使用 CocoaPods (Swift) 集成 Parse 时出错

    ios - 如何修复 Xcode 分析问题

    iphone - 尝试为通用 iOS 开发创建优化图像,我应该从哪里开始?

    firebase - react-native-fetch-blob 正在阻止 React Native 应用程序中的 Firebase 调用

    reactjs - 使用 Jest + React Native 测试组件中导入的图像

    ruby - 为什么我尝试更新 cocoapods 时会收到此错误?

    ruby - 运行 pod 设置给我 "bad interpreter: No such file or directory"错误

    ios - 如何显示模拟器日志?在 IOS 12.0 和 Xcode 10 中?

    ios - XIB 中的淡入/淡出 UISegmentedControl