首页 > 解决方案 > ARM Mac - 无法运行 react-native run-ios

问题描述

我运行以下命令来创建一个项目

react-native init test

cd iOS

pod install

稍后从项目主目录

react-native run-ios

我收到以下错误

** BUILD FAILED **


The following build commands failed:
     CompileC /Users/sp/Library/Developer/Xcode/DerivedData/test-ausxdgmizfvufjajqpwlgewxxhww/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Flipper-Folly.build/Objects-normal/x86_64/DistributedMutex.o /Users/sp/Documents/GitHub/Self/test/ios/Pods/Flipper-Folly/folly/synchronization/DistributedMutex.cpp normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)

需要帮助解决这个问题。

标签: react-nativeapple-m1

解决方案


xCode 12.5 是这里的问题。它似乎破坏了 react-native 构建。这里提到了解决方案 - https://github.com/facebook/react-native/issues/31179#issuecomment-830184757

看起来你在 react-native 0.64

  1. 更新podfile使用
use_flipper!('Flipper' => '0.75.1', 'Flipper-Folly' => '2.5.3')
  1. 更新package.json使用
"react-native": "facebook/react-native#cf8a364767df830d7255339741350bb53ab1a68a"

如果这不起作用,

  1. use_flipper!从您的podfile(禁用脚蹼)中删除
  2. pod install
  3. 清理并重建

推荐阅读