【问题标题】:Xcode File not found while trying to run app尝试运行应用程序时找不到 Xcode 文件
【发布时间】:2014-10-09 14:05:40
【问题描述】:

我在 Xcode 中遇到此错误,然后我尝试运行我的应用程序

Ld /Users/danielsorensen/Library/Developer/Xcode/DerivedData/Keyboard-cimemloksqjdnxhkdziqxwhxgwcg/Build/Products/Debug-iphonesimulator/KeyboardTests.xctest/KeyboardTests normal x86_64
    cd "/Users/danielsorensen/Downloads/codecanyon-9105493-color-keyboard-universal/Color Custom Keyboard"
    export IPHONEOS_DEPLOYMENT_TARGET=8.0
    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch x86_64 -bundle -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.0.sdk -L/Users/danielsorensen/Library/Developer/Xcode/DerivedData/Keyboard-cimemloksqjdnxhkdziqxwhxgwcg/Build/Products/Debug-iphonesimulator -F/Users/danielsorensen/Library/Developer/Xcode/DerivedData/Keyboard-cimemloksqjdnxhkdziqxwhxgwcg/Build/Products/Debug-iphonesimulator -F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.0.sdk/Developer/Library/Frameworks -F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks -F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.0.sdk/Developer/Library/Frameworks -filelist /Users/danielsorensen/Library/Developer/Xcode/DerivedData/Keyboard-cimemloksqjdnxhkdziqxwhxgwcg/Build/Intermediates/Keyboard.build/Debug-iphonesimulator/KeyboardTests.build/Objects-normal/x86_64/KeyboardTests.LinkFileList -Xlinker -rpath -Xlinker @executable_path/Frameworks -Xlinker -rpath -Xlinker @loader_path/Frameworks -bundle_loader /Users/danielsorensen/Library/Developer/Xcode/DerivedData/Keyboard-cimemloksqjdnxhkdziqxwhxgwcg/Build/Products/Debug-iphonesimulator/Color\ Custom\ Keyboard.app/Color\ Custom\ Keyboard -Xlinker -objc_abi_version -Xlinker 2 -framework XCTest -L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator -Xlinker -add_ast_path -Xlinker /Users/danielsorensen/Library/Developer/Xcode/DerivedData/Keyboard-cimemloksqjdnxhkdziqxwhxgwcg/Build/Intermediates/Keyboard.build/Debug-iphonesimulator/KeyboardTests.build/Objects-normal/x86_64/KeyboardTests.swiftmodule -mios-simulator-version-min=8.0 -Xlinker -dependency_info -Xlinker /Users/danielsorensen/Library/Developer/Xcode/DerivedData/Keyboard-cimemloksqjdnxhkdziqxwhxgwcg/Build/Intermediates/Keyboard.build/Debug-iphonesimulator/KeyboardTests.build/Objects-normal/x86_64/KeyboardTests_dependency_info.dat -o /Users/danielsorensen/Library/Developer/Xcode/DerivedData/Keyboard-cimemloksqjdnxhkdziqxwhxgwcg/Build/Products/Debug-iphonesimulator/KeyboardTests.xctest/KeyboardTests

ld: file not found: /Users/danielsorensen/Library/Developer/Xcode/DerivedData/Keyboard-cimemloksqjdnxhkdziqxwhxgwcg/Build/Products/Debug-iphonesimulator/Color Custom Keyboard.app/Color Custom Keyboard
clang: error: linker command failed with exit code 1 (use -v to see invocation)

【问题讨论】:

标签: xcode file testing


【解决方案1】:

我遇到了同样的错误,我按照以下步骤解决了它:

1) 进入项目

2) 在左侧栏(在出现的屏幕中点击测试

3) 转到构建设置选项卡并查找“测试主机”

4) 现在出现在该字段中的路径可能是错误的,因此您只需将其更新为适当的路径(在我的特殊情况下,我重命名了项目和一些文件夹,因此一些路径是错误的)

如果您仍然看到错误,那么您可能需要在构建设置选项卡中修复一些其他路径。

【讨论】:

  • 巨大的帮助,谢谢。我的设置为$(BUNDLE_LOADER),所以我更改了Bundle Loader 设置(在链接部分)。这确实是由于自创建 Tests 目标以来应用名称发生了变化。
  • 太棒了!谢谢!
【解决方案2】:

转到Project -- > Build Settings --> Testing --> Test Host 从 Debug 和 Release 中删除路径并给出正确的路径。 如果您不知道正确的路径,请将其保留为空,然后对其进行清理并构建。

这对我来说很好。

【讨论】:

    【解决方案3】:

    我通过选择 Tests 目标并在 Build Settings 中搜索 Bundle Loader 并更改该路径中的产品名称来解决此问题。我收到此错误是因为我更改了产品名称。 Bundle 加载程序在路径中有旧的产品名称,因此它会搜索该路径。

    【讨论】:

    • 你的答案是对的,但另一个答案中的图片首先引起了我的注意:)
    【解决方案4】:

    转到顶部给出的项目名称。点击它。转到“新方案”并将名称更改为您想要的任何名称。

    【讨论】:

      猜你喜欢
      • 2017-02-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-06-30
      • 1970-01-01
      • 2014-05-11
      • 2013-08-17
      相关资源
      最近更新 更多