3

我的目标是运行一个反应原生构建(ios 版本)。

情况一

  • 行动:启动地铁(好的)
  • 构建ios。问题:构建失败,退出代码为 1。
(CompileC /Users/macbook/Library/Developer/Xcode/DerivedData/NAME_OF_PROJECT-gxlagomyefvmjkdemiakcfycxnhx/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Flipper.build/Objects-normal/x86_64/FlipperRSocketResponder.o /Users/macbook/Documents/work/omg/mobile/ios/Pods/Flipper/xplat/Flipper/FlipperRSocketResponder.cpp normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler)

情况2

  • 行动:构建 ios。
  • 问题:鳍状肢::Typedef redefinition with different types ('uint8_t' (aka 'unsigned char') vs 'enum clockid_t'

版本

  • xcode 版本 12.5
  • IOS 9+
  • 苹果手机 12

我尝试的一些操作无效:

  1. 解决方案 1

  2. 解决方案 2

  3. 重新安装所有 pod

  4. 更新所有 pod

  5. 重建项目

    • rm -Rf 吊舱/*
    • pod 缓存清理 --all
    • 吊舱安装

以及其他一些小修复。任何帮助,将不胜感激。

4

2 回答 2

2

更改Podfile如下:

  post_install do |installer|
    react_native_post_install(installer)
    __apply_Xcode_12_5_M1_post_install_workaround(installer)
    `sed -i -e  $'s/__IPHONE_10_0/__IPHONE_12_0/' Pods/RCT-Folly/folly/portability/Time.h`
  end

运行pod install,它的工作原理!

于 2021-11-29T08:39:38.630 回答
0

当我尝试在 ios 模拟器上运行它时,我在第一个 react-native 项目中也遇到了同样的问题。

时钟id_t

clockid_t是您系统之一的一部分。该错误实际上是为了重新定义clockid_t两次。

重命名clockid_t为其他东西解决了我的问题。我将它从clockid_tto重命名clockid_tt,然后我的项目运行顺利。

因为我是初学者 react-native 开发人员,所以我不确定这个解决方案是否会在我的 react-native 项目中产生任何未来的问题。这个解决方案还没有遇到任何问题。

于 2021-11-19T16:51:57.270 回答