我正在开发没有 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”文件
请建议我解决它,因为我试图搜索但没有找到任何解决方案。
请同时检查此屏幕截图。
请找到我的 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 PATHS
在 jsiexecutor
的 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_PATHS
的 jsiexecutor
要阅读的子规范: 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/