【问题标题】:ARM Mac - unable to run react-native run-iosARM Mac - 无法运行 react-native run-ios
【发布时间】:2021-04-30 18:18:41
【问题描述】:

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

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-native apple-m1


    【解决方案1】:

    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. 从您的 podfile 中删除 use_flipper!(禁用脚蹼)
    2. 运行pod install
    3. 清理并重建

    【讨论】:

    • 看起来它与 ARM Mac 无关,而是与 Mac OS 本身有关。它在上次 Mac OS 更新后出现
    猜你喜欢
    • 2020-05-16
    • 2021-02-23
    • 2019-01-14
    • 1970-01-01
    • 2023-03-17
    • 2016-07-07
    • 2019-10-05
    • 1970-01-01
    相关资源
    最近更新 更多