ios - Xcode 4.5.1 中的 “File not found” , “linker command failed with exit code 1”

标签 ios unit-testing linker-errors file-not-found

我正在开发一个现有的 iOS 应用程序,我必须为此项目编写单元测试用例。它正在 Simulator 6.0 中构建和运行。 每当我尝试测试该项目时,它都会显示以下错误消息。我无法找出确切的错误。

id: file not found: /Users/Yuva/Library/Developer/Xcode/DerivedData/FlyApp-aexukpgtbathuadgxlnm/Build/Products/Debug-iphonesimulator/FlyApp.app/FlyApp
clag: error: linker command failed with exit code 1 (use -v to see invocation)

你能帮我解决这个链接器错误并测试应用吗?

最佳答案

解决步骤:

  1. 创建不同名称的新方案
  2. 删除旧方案

  3. 添加新方案

问题出在哪里:

我更改了产品名称并禁用了快照选项。然后,突然,这个错误弹出:

ld:找不到文件:.././previousproductname.app/previousproductname

我调试失败的步骤:

  1. 删除派生数据,重新启动 Xcode。 - 未解决。

  2. 按照以下步骤操作:链接 http://twobitlabs.com/2011/06/adding-ocunit-to-an-existing-ios-project-with-xcode-4/ - 同样的错误;没有解决。

  3. 最后,我更改了Scheme名称,删除了我的旧方案并添加了新方案,解决了我的问题。

关于ios - Xcode 4.5.1 中的 “File not found” , “linker command failed with exit code 1”,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15950653/

相关文章:

unit-testing - Mocha sinon.spy 总是显示函数调用 0 次

c - 查找 `undefined reference` 错误的根本原因

ios - 为什么背景图像覆盖了 SKCropNode child ?

ios - OpenGL ES 2/iOS GLKit 的设计建议

c# - 如何让类更具可测性?

c++ - 尝试 CS106B 时出现链接错误

c++ -/usr/bin/ld : cannot find lGL when building Qt5 app in Qt Creator on Linux Mint

ios - XCODE 6 (6A313) 使用 Outlets 编译错误

objective-c - 查找阻塞主线程的代码的最佳方法是什么?

unit-testing - AngularJS/Jasmine 测试中的模拟日期