ios 命令 /Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang 失败,退出代码为 1

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

Command /Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang failed with exit code 1

iphoneobjective-ciosipad

提问by Eman87

I'm trying to do an application reading pdf using pdf kit in Xcode 4.3 but it gives me the following error

我正在尝试使用 Xcode 4.3 中的 pdf 工具包读取 pdf 的应用程序,但它给了我以下错误

ld: duplicate symbol _OBJC_METACLASS_$_OverlayManager in /Users/dt4it/Library/Developer/Xcode/DerivedData/MyPdf4-bmkjglhhvneluqcbwpceiqjvdcmq/Build/Intermediates/MyPdf4.build/Debug-iphonesimulator/MyPdf4.build/Objects-normal/i386/OverlayManager-D0866CFD31A05E68.o and /Users/dt4it/Library/Developer/Xcode/DerivedData/MyPdf4-bmkjglhhvneluqcbwpceiqjvdcmq/Build/Intermediates/MyPdf4.build/Debug-iphonesimulator/MyPdf4.build/Objects-normal/i386/OverlayManager-B31AE7412100AF6D.o for architecture i386
Command /Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang failed with exit code 1

any help please ??

有什么帮助吗??

回答by ullstrm

Project Settings > Under "Targets", select your project > Build Phases > open "Compile Sources" and "Copy Bundle Resources". Check if any files are listed in red color. If so , just delete it. Then clean and run.

项目设置 > 在“目标”下,选择您的项目 > 构建阶段 > 打开“编译源”和“复制捆绑资源”。检查是否有任何文件以红色列出。如果是这样,只需将其删除。然后清理并运行。

Worked for me.

为我工作。

回答by redux

Do a clean. product > clean. Terminal purge & reboot didn't work for me, cleaning did.

干干净净。 product > clean. 终端清除和重新启动对我不起作用,清洁起作用了。

回答by Boeckm

I had this same error and nobody seems to have an answer on StackOverflow that actually works. My problem was when I tried copying a project that was in a team repository. Turns out, in the ignore file, all files with the extension of *.pchwere ignored from repository commits. This means that when I went to pull the project from the repo, the .pchfile was missing, thus throwing this error.

我有同样的错误,似乎没有人在 StackOverflow 上有一个真正有效的答案。我的问题是当我尝试复制团队存储库中的项目时。结果是,在忽略文件中,所有扩展名为 的文件*.pch都从存储库提交中被忽略了。这意味着当我从 repo 中提取项目时,.pch文件丢失了,从而引发了这个错误。

Fortunately I had a copy of the project still and was able to just copy the .pchfile over and I was then able to compile just fine.

幸运的是,我仍然拥有该项目的副本,并且能够将.pch文件复制过来,然后我就可以很好地编译了。

Hope this helps?

希望这可以帮助?

回答by fnc12

Go to target preferences, summary tab, find "Deployment target" and increase it.

转到目标首选项,摘要选项卡,找到“部署目标”并增加它。

回答by Ricardo

I face this problem too. And ofc I looked for help in SO instead of use the common sense and check the error message.

我也面临这个问题。而且我在 SO 中寻求帮助而不是使用常识并检查错误消息。

The last part of the error message was the same as you.

错误消息的最后一部分与您相同。

Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang failed with exit code 11

But few lines above I found:

但我发现上面几行:

In file included from /Users/Ricardo/Documents/XCode/RealEstate-Finder-v1.2/RealEstateFinder/RealEstateFinder/RealEstateFinder-Prefix.pch:26:
/Users/Ricardo/Documents/XCode/RealEstate-Finder-v1.2/RealEstateFinder/RealEstateFinder/Config/Config.h:174:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
http://www.myserver.com/apps/mobile/rest.php?id=12

Which points to my Config.h file.

它指向我的 Config.h 文件。

Happy coding!

快乐编码!

回答by TharakaNirmana

deleting ~/Library/Developer/Xcode/DerivedDatahelped me.

删除~/Library/Developer/Xcode/DerivedData帮助了我。

reference : link

参考:链接

回答by Neeraj Pathak

This problem usually occurs when there are more than two versions of XCode are installed in which different Swift versions incorporated for Ex. XCode 6.4 and XCode 7.3 are installed which are running Swift 1.2 and Swift 2.0. By mistake you tries to compile code with icorrect version for Ex. your project in in Swift 1.2 and you tries to compile it with xcode 7.3. In this case drive data stores information for swift version but when you tries to compile code with correct XCode it gives error. To resolve this

当安装了两个以上的 XCode 版本时,通常会出现此问题,其中为 Ex 合并了不同的 Swift 版本。安装了运行 Swift 1.2 和 Swift 2.0 的 XCode 6.4 和 XCode 7.3。您错误地尝试使用不正确的 Ex 版本编译代码。你的项目在 Swift 1.2 中,你试图用 xcode 7.3 编译它。在这种情况下,驱动器数据存储 swift 版本的信息,但是当您尝试使用正确的 XCode 编译代码时,它会出错。为了解决这个

  1. Delete drive Data
    a. In Xcode select preferences
  1. 删除驱动器的数据
    一个。在 Xcode 中选择首选项

enter image description here

在此处输入图片说明

  1. Once preferences are open click on Location tab and click on the arrow in front of the 'Drived data' path. It will open drived data folder
  1. 打开首选项后,单击位置选项卡,然后单击“驱动数据”路径前面的箭头。它将打开驱动数据文件夹

enter image description here

在此处输入图片说明

  1. Quit Xcode
  2. Delete all drive data.
  3. reopen the project in correct XCode error is fixed !!!!!!
  1. 退出 Xcode
  2. 删除所有驱动器数据。
  3. 在正确的 XCode 中重新打开项目错误已修复!!!!!!

回答by Nimmy

Try this - click on the name of your project on the list of files/folders on the left in Xcode (at the very top of the list). Look at the "Targets" section on the left-hand side of the window to the right. Likely, there's two listed with the second being a "test" item. Right-click on that item and select "delete". Then try to run the project again.

试试这个 - 在 Xcode 左侧的文件/文件夹列表中点击你的项目名称(在列表的最顶部)。查看右侧窗口左侧的“目标”部分。可能列出了两个,第二个是“测试”项目。右键单击该项目并选择“删除”。然后尝试再次运行该项目。

回答by longi

For me this error appears after cloning the project from a repository. Someone removed a white space from the projects name (renamed: "The Project" to "TheProject") which caused some Build Settingserrors to unvalid paths.

对我来说,从存储库克隆项目后会出现此错误。有人从项目名称中删除了一个空格(重命名为:“The Project”到“TheProject”),这会导致Build Settings无效路径的一些错误。

Sometimes reading the whole error logs is not a bad idea....

有时阅读整个错误日志并不是一个坏主意......

回答by i_duhh_bomb

The same thing happened to me and i found that i forgot to put the " at the end of the

同样的事情发生在我身上,我发现我忘了把“放在”的末尾

#import "CPDConstants.h

so instead

所以与其

#import "CPDConstants.h"