【问题标题】:iOS build: command ld failed with a nozero exit codeiOS 构建:命令 ld 失败,退出代码为零
【发布时间】:2020-05-15 07:08:10
【问题描述】:

对于一个 react-native 项目,我在 Xcode 构建期间收到以下错误:

clang: error: no such file or directory: '/Users/user172615/Library/Developer/Xcode/DerivedData/xxx/Build/Products/Debug-appletvsimulator/libBVLinearGradient.a' Command Ld failed with a nonzero exit code

这发生在添加react-native-linear-gradient 后,并按照https://github.com/react-native-community/react-native-linear-gradient 中的说明进行操作(iOS 手动安装)。

  1. https://github.com/react-native-community/react-native-linear-gradient#manually 中所指定,libBVLinearGradient.a 包含在目标myProjectBuild Phases -> Link Binary With Libraries
  2. libBVLinearGradient.a 也包含在General -> Frameworks, Libraries and embedded content 中。
  3. 我尝试删除 DerivedData,然后重新构建。没有帮助。
  4. 由于错误指示Debug-appletvsimulator,我将libBVLinearGradient.a 包含在Build Phases -> Link Binary With Libraries 中,用于目标myProject-tvOS
  5. 当这没有帮助时,我删除了myProject-tvOS 目标。一切都没有帮助。

我使用的是 Xcode 11.3,react-native 0.59.9。

有什么想法吗?

【问题讨论】:

  • libBVLinearGradient.a 库是否存在并包含在您的 iOS 目标中?
  • 是的,在 Build Phases -> Link Binary With Libraries and General -> Frameworks, Libraries and embedded content 。我用更多细节更新了这个问题。

标签: xcode react-native-ios


【解决方案1】:
  1. 不要下载它,而是这样做。

点击克隆现有项目

然后复制这个链接

https://github.com/react-native-community/react-native-linear-gradient

并在此处粘贴链接

然后它将下载项目。

如果问题仍然存在,则创建一个新项目,复制并粘贴所有内容。

【讨论】:

  • 把链接粘贴到哪里?
  • 将链接粘贴到顶部
  • 在什么之上? :) 在 package.json 中?
  • 当你从 git 呼吸中按克隆时,会有一个文本字段;在那里你粘贴链接
  • 好的...但是我不想创建新的存储库,而是使用我自己的已经在 android 上运行的存储库。对我应该为现有项目做什么有什么建议吗?
猜你喜欢
  • 1970-01-01
  • 2021-08-23
  • 1970-01-01
  • 2018-03-23
  • 2023-01-20
  • 2018-12-11
  • 1970-01-01
  • 2020-10-28
  • 2019-02-24
相关资源
最近更新 更多