尝试运行应用程序时找不到 Xcode 文件

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/26280543/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 05:49:39  来源:igfitidea点击:

Xcode File not found while trying to run app

xcodefiletesting

提问by Daniel Juhl S?rensen

I'm Getting this error in Xcode then I try to run my app

我在 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)

回答by Potajedehabichuelas

I got the same error and I solved it by following these steps:

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

1) Go to the project

1)进入项目

2) On the left side bar (in the screen that appears click on Tests

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

3) Go to the build settings tab and look for "test host"

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

4) Now the path that appears in the field is probably wrong so you just need to update it to the appropriate one (In my particular case I renamed the project and some folders and so some paths were wrong) enter image description here

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

If you still see the error then you might need to fix some other paths in the Build settings tabs.

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

回答by Daya Kevin

Go to Project -- > Build Settings --> Testing --> Test HostRemove the paths from Debug and Release and give the correct path. If you don't know the correct path just keep it empty and then clean it and build.

转到Project -- > Build Settings --> Testing --> Test Host从调试和发布中删除路径并提供正确的路径。如果您不知道正确的路径,只需将其留空,然后清理并构建即可。

This works fine for me.

这对我来说很好用。

回答by Madhu

I got this fixed by selecting the Tests target and searching for Bundle Loader in Build Settings and changing the product name in that path. I got this error because I have changed the Product name. The Bundle loader has the old product name in the path, so it searches for that path.

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

回答by Rana Raza

Go to project name that given on top. Click on it. Go to "New Scheme" and change the Name to whatever you want.

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