ios 在 Xcode 中更改产品名称后出现“ld: file not found”
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/29182257/
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
'ld: file not found' after changing product name in Xcode
提问by hamzah
I was working on my application and i started out with a really bad name. So i decided to change it. I did that like this.
我正在处理我的应用程序,但我的名字非常糟糕。所以我决定改变它。我是这样做的。
At the top right corner i simply changed the name to what i want. and then i started getting the error as you can see there. Reveal in Logshows these details:
在右上角,我只是将名称更改为我想要的名称。然后我开始收到错误,正如您在那里看到的那样。Reveal in Log显示了这些细节:
The main error says:
主要错误说:
ld: file not found: /Users/.../XCode/DerivedData/...
ld:找不到文件:/Users/.../XCode/DerivedData/...
回答by Vamshi Krishna
Go to edit scheme as shown below.
转到如下所示的编辑方案。
then uncheck all other targets except your main target under build tab.
然后在构建选项卡下取消选中除主要目标之外的所有其他目标。
回答by Peege151
I recently got this error under different circumstances. Running Ionic, updating my ios platform from 3.8.0 to 4.0.1 I discovered this error.
我最近在不同的情况下遇到了这个错误。运行 Ionic,将我的 ios 平台从 3.8.0 更新到 4.0.1 我发现了这个错误。
I had to disable bitcode in my app.
我不得不在我的应用程序中禁用位码。
To do this, click your top level app icon in the file structure. In the main window, click the header build settings. In the search bar, type bit (or bitcode) and you should see enable bit code beneath
为此,请单击文件结构中的顶级应用程序图标。在主窗口中,单击标题构建设置。在搜索栏中,键入 bit(或 bitcode),您应该会在下方看到启用位代码
I had disabled it before, but I'm guessing that updating the ios platform enables bitcode so it needed to be disabled again.
我之前禁用了它,但我猜更新 ios 平台会启用位码,因此需要再次禁用它。
回答by Edison
回答by YoshiJaeger
Real Issue
真正的问题
After changing the PRODUCT_NAME
(as seen in the question) the erroneous reference to Host Applicationis the real cause of the issue.
更改后PRODUCT_NAME
(如问题所示)对主机应用程序的错误引用是问题的真正原因。
Just select your Tests-Target and under the General-Tab select your updated Host Application.
只需选择您的 Tests-Target 并在 General-Tab 下选择您更新的 Host Application。
Afterwards, building the project will work.
之后,构建项目将起作用。
回答by TechFanatic
I resolved this by Deleting the Derived Data and rebuilding the project.
我通过删除派生数据并重建项目解决了这个问题。
- Go to Windows > Projects
- Select Your Project
- Delete Derived Data
- Build your project and Run
- 转到 Windows > 项目
- 选择您的项目
- 删除派生数据
- 构建您的项目并运行
回答by Hwangho Kim
If you see this error without detail result then check 'enum' in header file. Move them in .m file.
如果您在没有详细结果的情况下看到此错误,请检查头文件中的“枚举”。将它们移动到 .m 文件中。
回答by O_k
By deleting the derived data Xcode will recompile and regenerate the data for you.
通过删除派生数据,Xcode 将为您重新编译并重新生成数据。
You can do that by going to: Windows -> projects Delete derived data
您可以通过以下方式执行此操作:Windows -> 项目 删除派生数据