xcode 无法摆脱 Apple LLVM 5.0 错误

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

Can't get rid of Apple LLVM 5.0 Error

iosxcodexcode5

提问by Aeveus

It keeps saying:

它一直在说:

fatal error: file '/Applications/Xcode5-DP5.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/usr/include/objc/NSObject.h'

has been modified since the precompiled header

'/Users/Hymaniexu/Library/Developer/Xcode/DerivedData/ModuleCache/2MWVPCGUMQ29P/ObjectiveC.pcm' was built

note: after modifying system headers, please delete the module cache at '/Users/Hymaniexu/Library/Developer/Xcode/DerivedData/ModuleCache/2MWVPCGUMQ29P'

1 error generated.

致命错误:文件“/Applications/Xcode5-DP5.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/usr/include/objc/NSObject.h”

自预编译头以来已被修改

'/Users/Hymaniexu/Library/Developer/Xcode/DerivedData/ModuleCache/2MWVPCGUMQ29P/ObjectiveC.pcm'被构建

注意:修改系统头文件后,请删除'/Users/Hymaniexu/Library/Developer/Xcode/DerivedData/ModuleCache/2MWVPCGUMQ29P'的模块缓存

产生了 1 个错误。

I must have deleted the derived data at least five times by now, and I'm getting nowhere. Any ideas?

到目前为止,我必须至少删除了五次派生数据,但我一无所获。有任何想法吗?

回答by Neva

Open a terminal and type in : rm -rf ~/Library/Developer/Xcode/DerivedData/ModuleCache/*

打开终端并输入:rm -rf ~/Library/Developer/Xcode/DerivedData/ModuleCache/*

Clean your project and build again. Worked for me.

清理您的项目并重新构建。对我来说有效。

回答by coneybeare

Delete the folder, clean the app, restart Xcode if necessary.

删除文件夹,清理应用程序,必要时重新启动 Xcode。

回答by Abhilash Reddy Kallepu

as per xcode 5.

按照 xcode 5。

  1. click on Xcode preferences
  2. Goto locations tab
  3. click on the derived data path which navigates to the folder called DerivedData
  4. Delete the whole folder and restart xcode.
  1. 单击 Xcode 首选项
  2. 转到位置选项卡
  3. 单击导航到名为的文件夹的派生数据路径 DerivedData
  4. 删除整个文件夹并重新启动xcode。

This works fine for me.

这对我来说很好用。

Happy coding :)

快乐编码:)

回答by Yunus Nedim Mehel

The same thing was occuring to me. The warning was telling me:

同样的事情发生在我身上。警告告诉我:

After modifying system headers, please delete the module cache at '/Users/yunus.mehel/Library/Developer/Xcode/DerivedData/ModuleCache/13XL2DHZVON89'

修改系统头文件后,请删除'/Users/yunus.mehel/Library/Developer/Xcode/DerivedData/ModuleCache/13XL2DHZVON89'的模块缓存

So, I have restarted xcode, deleted derived data from Organizer, deleted derived data from the derivedData folder; none of them worked. Then I have realized, the solution was already there; go to:

所以,我重新启动了 xcode,从 Organizer 中删除了派生数据,从衍生数据文件夹中删除了派生数据;他们都没有工作。然后我意识到,解决方案已经存在;去:

"DerivedData/ModuleCache/13XL6DH2BON89"

"派生数据/ModuleCache/13XL6DH2BON89"

and delete that folder, notthe "DerivedData/<your_project>". Make a clean build, it will work again.

并删除该文件夹,而不是“DerivedData/<your_project>”。做一个干净的构建,它会再次工作。

回答by Arbitur

Have you tried reinstalling xcode? And have you cleaned using cmd+shift+k ?

您是否尝试过重新安装 xcode?您是否使用 cmd+shift+k 进行了清理?

回答by orkoden

Run this scriptto delete all relevant files in /Library/Developer/Xcode/DerivedDataand /var/folders:

运行此脚本,删除所有相关的文件/Library/Developer/Xcode/DerivedData/var/folders

# run with
# ruby reallyCleanXcode.rb
derivedDataFolder = Dir.glob(Dir.home + "/Library/Developer/Xcode/DerivedData/*")
moduleCache = Dir.glob("/var/folders/**/com.apple.DeveloperTools*")
FileUtils.rm_rf derivedDataFolder + moduleCache

回答by Sophy Swicz

This happen when compiling, when running the app or neither?

编译时发生这种情况,运行应用程序时或两者都不发生?

Have you tried this:

你有没有试过这个:

Build Settings - Build Locations - Precompiled Header Cache Path -- there's a folder... delete it.

构建设置 - 构建位置 - 预编译头缓存路径 - 有一个文件夹......删除它。

回答by Van Du Tran

I solved this by:

我通过以下方式解决了这个问题:

Quit restart Xcode + clean project + clean build folders + clean derived data + deleted the /var/folders/.../.../C/com.apple.DeveloperTools/5.0.2-5A3005/Xcode/SharedPrecompiledHeaders + unplugged my iPhone

退出重新启动 Xcode + 清理项目 + 清理构建文件夹 + 清理派生数据 + 删除 /var/folders/.../.../C/com.apple.DeveloperTools/5.0.2-5A3005/Xcode/SharedPrecompiledHeaders + 拔掉我的苹果手机

Rebuild and works :)

重建和工作:)

回答by Saif Ali Khan

I used Shift+ CMD+ Kto try and clean the project, but it did not disappear.

我用Shift+ CMD+ K,试图清理项目,但它并没有消失。

All I had to do was go and check the names of <yourProjectName>-info.plistand <yourProjectName>-Prefix.pch.

我所要做的就是去检查<yourProjectName>-info.plist<yourProjectName>-Prefix.pch.

Then Shift+ CMD+ Kworked.

然后Shift+ CMD+K的工作。

In my case the problem was Clang exiting with code 1.

就我而言,问题是 Clang 以代码 1 退出。

回答by lbsweek

my solution,

我的解决方案,

in terminal, run command:

在终端中,运行命令:

rm -rf /Users/Hymaniexu/Library/Developer/Xcode/DerivedData/ModuleCache/2MWVPCGUMQ29P

then in xcode, clean then restart xcode and build

然后在 xcode 中,清理然后重新启动 xcode 并构建