【发布时间】:2020-06-12 06:15:58
【问题描述】:
与yoga/yoga.h file not found RCTConvert.h 中的问题相同,但那里的答案没有帮助。
我在 macOS Catalina (10.15.4) 上使用 Xcode 11.3,react-native 0.62.2,并在尝试构建时收到此错误。
知道我应该怎么做吗?
RCCTonvert.h中的import语句:
#import <yoga/Yoga.h>
文件的位置
./node_modules/react-native/React/Base/RCTConvert.h
./node_modules/react-native/ReactCommon/yoga/yoga/Yoga.h
构建设置 -> 标头搜索路径
如下所示,我尝试添加瑜伽目录。没有帮助。
这是我的 podfile:
platform :ios, '11.0'
target 'xxx' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!
permissions_path = '../node_modules/react-native-permissions/ios'
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-RCTSettings', :path => '../node_modules/react-native/Libraries/Settings'
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-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', :modular_headers => true
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'
# Pods for xxx
pod 'RNSquareInAppPayments', :path => '../node_modules/react-native-square-in-app-payments'
pod 'BVLinearGradient', :path => '../node_modules/react-native-linear-gradient'
pod 'react-native-nfc-manager', :path => '../node_modules/react-native-nfc-manager'
target 'xxxTests' do
inherit! :search_paths
# Pods for testing
end
end
target 'xxx-tvOS' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!
# Pods for xxx-tvOS
target 'xxx-tvOSTests' do
inherit! :search_paths
# Pods for testing
end
end
【问题讨论】:
-
您找到解决方案了吗?
-
尴尬的是,我不记得了……我遇到了很多问题并以某种方式解决了这个问题。我将发布一个答案,其中包含我现在正在使用的 podfile,它正在工作。
-
谢谢!对于以后遇到这个问题的其他人,我通过将 cocoapods 更新到最新版本来解决它。
-
我建议你发布一个答案
标签: xcode cocoapods react-native-ios yoga-x1