【问题标题】:Unable to run react native project on iOS无法在 iOS 上运行 React Native 项目
【发布时间】:2021-12-20 01:20:39
【问题描述】:

我正在使用 Mac M1,当我尝试执行 npm run ios 时出现以下错误。在互联网上找不到解决方案解决我的问题:(请帮助

The following build commands failed:
        Ld /Users/fullmad/Library/Developer/Xcode/DerivedData/SagaReserve-hdvaajmlsndpidftnfyqfuxydjqw/Build/Products/Debug-iphonesimulator/SagaReserve.app/SagaReserve normal (in target 'SagaReserve' from project 'SagaReserve')
(1 failure)

这就是控制台中的所有内容: https://pastebin.com/gaCEJRJx

【问题讨论】:

  • 你能分享一下实际的错误信息吗?
  • @UgurEren 嗨,我已经更新了问题

标签: ios xcode react-native


【解决方案1】:

我也在 M1 上使用 Macbook Pro 进行 React Native 开发。 arm64 架构也有一些问题。

这对我有帮助

FIRST:从构建中排除 arm64 架构:

  1. 在 xcode 中打开你的 ios/*project_name*.xcworkspace
  2. 在 xcode 左侧选择您的项目。
  3. 转到Build Settings
  4. 在选项卡(基本/自定义/全部)中选择All
  5. 搜索“排除”
  6. 将所有Excluded Architectures 设置为arm64

第二个:将 XCode 设置为使用 Rosetta

  1. 在 Finder 中转到 Applications 文件夹
  2. 查找 XCode
  3. 打开应用程序菜单并选择Get info
  4. 选择Open using Rosetta

希望对你也有帮助。祝你好运!

【讨论】:

  • 您好@WitoDivaro,在完成您描述的所需步骤后,我仍然收到上述错误
猜你喜欢
  • 1970-01-01
  • 2019-10-05
  • 2019-03-27
  • 2023-03-17
  • 1970-01-01
  • 1970-01-01
  • 2016-07-12
  • 2016-05-02
  • 1970-01-01
相关资源
最近更新 更多