首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >RCTConvert.h:找不到'yoga/Yoga.h‘文件

RCTConvert.h:找不到'yoga/Yoga.h‘文件
EN

Stack Overflow用户
提问于 2020-06-12 14:15:59
回答 2查看 413关注 0票数 1

yoga/yoga.h file not found RCTConvert.h中的问题相同,但那里的答案没有帮助。

我在macOS Catalina (10.15.4)上使用Xcode11.3,react-native 0.62.2,当我尝试构建时得到这个错误。

你知道我该怎么做吗?

RCTConvert.h中的import语句:

代码语言:javascript
运行
复制
#import <yoga/Yoga.h>

文件的位置

代码语言:javascript
运行
复制
 ./node_modules/react-native/React/Base/RCTConvert.h
 ./node_modules/react-native/ReactCommon/yoga/yoga/Yoga.h

生成设置->标头搜索路径

正如您在下面看到的,我尝试添加了yoga目录。没帮上忙。

这是我的podfile:

代码语言:javascript
运行
复制
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
EN

回答 2

Stack Overflow用户

发布于 2020-12-08 02:45:14

我以下面的podfile作为结束,它正在工作:

代码语言:javascript
运行
复制
platform :ios, '11.1'
require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

target 'xxx' do
  # Pods for xxx
  config = use_native_modules!
  use_react_native!(:path => config["reactNativePath"])

  pod 'react-native-netinfo', :path => '../node_modules/@react-native-community/netinfo'

  pod 'RNCAsyncStorage', :path => '../node_modules/@react-native-community/async-storage'

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

  pod 'react-native-blur', :path => '../node_modules/@react-native-community/blur'

  pod 'RNSentry', :path => '../node_modules/@sentry/react-native'

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

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

  target 'xxxTests' do
    inherit! :complete
    # Pods for testing
  end

  # Enables Flipper.
  #
  # Note that if you have use_frameworks! enabled, Flipper will not work and
  # you should disable these next few lines.
  use_flipper!
  post_install do |installer|
    flipper_post_install(installer)
  end
end

target 'xxx-tvOS' do
  # Pods for xxx-tvOS

  target 'xxx-tvOSTests' do
    inherit! :search_paths
    # Pods for testing
  end
end
票数 1
EN

Stack Overflow用户

发布于 2020-12-10 05:32:05

在我的例子中,我能够通过更新到cocoapods的最新版本(从1.5.0到1.10.0)来解决这个问题。

您可以使用以下命令检查已安装的cocoapods的版本:gem which cocoapods

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/62338563

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档