ios 链接错误/Build/Products/Debug-iphonesimulator 文件未找到

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/18165747/
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-08-31 00:40:06  来源:igfitidea点击:

Link error /Build/Products/Debug-iphonesimulator file not found

iosxcodelinker-errors

提问by Crazy

I have problem with Xcode, keeps giving me a linker error, and it doesn't build the project. The following is the error am getting

我的 Xcode 有问题,一直给我一个链接器错误,但它没有构建项目。以下是我得到的错误

ld: file not found: /Users/someuser/Library/Developer/Xcode/DerivedData/MAR-akbwbarcniqxytctbebckkelkbxs/Build/Products/Debug-iphonesimulator/MAR.app/MAR

clang: error: linker command failed with exit code 1 (use -v to see invocation)

ld:找不到文件:/Users/someuser/Library/Developer/Xcode/DerivedData/MAR-akbwbarcniqxytctbebckkelkbxs/Build/Products/Debug-iphonesimulator/MAR.app/MAR

clang:错误:链接器命令失败,退出代码为 1(使用 -v 查看调用)

回答by atitpatel

As some of the fellow developers have mentioned here, the root cause of the error was "Change in Product Name". I fixed it by :

正如这里的一些开发人员所提到的,错误的根本原因是“产品名称更改”。我通过以下方式修复它:

  1. Go to [project]Tests -> general

  2. Select Host Application

    enter image description here

  1. 转到 [项目] 测试 -> 常规

  2. 选择主机应用程序

    在此处输入图片说明

Credits : https://stackoverflow.com/a/28906400/2164029

学分:https: //stackoverflow.com/a/28906400/2164029

回答by iDurocher

I picked up a project that had this same error. I found that the project name had changed, but the code I had did not reflect that change in the project build settings. To correct, I updated the "Product Name" value (found under targets | Packaging) to the correct value and rebuilt the project. Ran fine.

我拿起了一个有同样错误的项目。我发现项目名称已更改,但我拥有的代码并未在项目构建设置中反映该更改。为了更正,我将“产品名称”值(在目标 | 包装下找到)更新为正确的值并重建项目。跑得很好。

回答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 Asdrubal

I had the exact same problem and if you are using cocoapods make sure you open your project with .xcworkspacenot .xcodeproj, for me it was that simple.

我遇到了完全相同的问题,如果您使用的是 cocoapods,请确保使用.xcworkspacenot打开您的项目.xcodeproj,对我来说就是这么简单。

回答by Joel Banzatto

I solved by running pod deintegratehttps://github.com/CocoaPods/cocoapods-deintegrate:

我通过运行pod deintegrate https://github.com/CocoaPods/cocoapods-deintegrate解决了:

pod deintegrate

pod deintegrate

pod install

pod install

回答by Jamal Zafar

Make a deep clean of your project by ? Clean(Menu >> Product >> Clean)

通过? Clean(菜单>>产品>>清洁)对您的项目进行深度清洁

回答by Crazy

I found the solution, I have removed what ever was in dependency. Build Phases -> target dependancies remove whatever in there. if there's test target also click on the test in the build phases in the target dependancies remove what ever in there.

我找到了解决方案,我已经删除了依赖项。构建阶段 -> 目标依赖项删除那里的任何内容。如果有测试目标,则还单击目标依赖项中构建阶段中的测试,删除其中的内容。

回答by Ben Thielker

I ended up resolving this in Xcode 7.3 by deletingthe Bundle Loadervalues under Build Settings. Seemed risky, but I noticed the other targets didn't have any such values defined; only the test targets (which were failing to build due to this error).

我最终在 Xcode 7.3 中通过删除Build Settings 下的Bundle Loader值解决了这个问题。看起来有风险,但我注意到其他目标没有定义任何这样的值;只有测试目标(由于此错误而无法构建)。

回答by Soapboxsketcher Apps

I got the same issue. What I did was to look for a different 'Product Name' listed under Build Settings. I found the old Product Name still listed under Packaging (Both the Product Name and Product Module Name had the old name). I changed it to the new one and the project compiled without error.

我遇到了同样的问题。我所做的是寻找构建设置下列出的不同“产品名称”。我发现旧的产品名称仍然列在包装下(产品名称和产品模块名称都有旧名称)。我把它改成新的,项目编译没有错误。