React-Native 新的 ios 项目未构建。RCT-愚蠢的语义问题

eug*_*544 7 ios reactjs react-native

我按照https://reactnative.dev/docs/environment-setup中的步骤进行操作,在初始化应用程序后,当我去构建我的应用程序时,它在终端中给出了此错误:

** BUILD FAILED **


The following build commands failed:
    CompileC /Users/----/Library/Developer/Xcode/DerivedData/AwesomeProject-fneeqrmgpvoyyygpzbykmsofeknl/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RCT-Folly.build/Objects-normal/x86_64/SysUio.o /Users/asaadat/Documents/CollegeStuff/EECS\ 441/test_app/AwesomeProject/ios/Pods/RCT-Folly/folly/portability/SysUio.cpp normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler (in target 'RCT-Folly' from project 'Pods')
    CompileC /Users/----/Library/Developer/Xcode/DerivedData/AwesomeProject-fneeqrmgpvoyyygpzbykmsofeknl/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RCT-Folly.build/Objects-normal/x86_64/NetOps.o /Users/asaadat/Documents/CollegeStuff/EECS\ 441/test_app/AwesomeProject/ios/Pods/RCT-Folly/folly/net/NetOps.cpp normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler (in target 'RCT-Folly' from project 'Pods')
(2 failures)
Run Code Online (Sandbox Code Playgroud)

在 xcode 中,当我尝试构建 ios 应用程序时,它向我显示以下内容: xcode 屏幕截图

我尝试重新安装 pod 和 pod 存储库更新,甚至重新开始教程。我还删除了node_modules并再次安装了npm。还是同样的错误。我使用的是 React-Native 0.66。

我是使用 React-Native 和 ios 进行开发的新手,我很困惑为什么一个全新的项目会展示这一点。

这是我的 Podfile:

require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

platform :ios, '11.0'

target 'AwesomeProject' do
  config = use_native_modules!

  use_react_native!(
    :path => config[:reactNativePath],
    # to enable hermes on iOS, change `false` to `true` and then install pods
    :hermes_enabled => false
  )

  target 'AwesomeProjectTests' 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 the next line.
  use_flipper!()

  post_install do |installer|
    react_native_post_install(installer)
    __apply_Xcode_12_5_M1_post_install_workaround(installer)
  end
end

Run Code Online (Sandbox Code Playgroud)

小智 7

我已经做出了更完整的答案,因此我们可以合作提出更好的答案。但既然它被删除了,我会更直接地“解决”。

line typedef uint8_t clockid_t;在文件中注释掉Pods/RCT-Folly/folly/portability/Time.h。通过添加前缀进行注释//

  • 谢谢!这为我解决了这个问题。但问题是,如果我更新或重新安装 pod,此更改会被覆盖吗? (2认同)