如何解决 xcode 5 中的苹果 LLVM 5.0 错误?

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

How to solve the apple LLVM 5.0 error in xcode 5?

iosxcodecompiler-errors

提问by Rashid

I was running my application without any problems on both the simulator and device. All of a sudden i get this error:

我在模拟器和设备上运行我的应用程序都没有任何问题。突然间我收到此错误:

fatal error: file  '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/System/Library/Frameworks/UIKit.framework/Headers/UICollectionView.h' has been modified since the precompiled header '/Users/rashidasgari/Library/Developer/Xcode/DerivedData/ModuleCache/SWBH8ZAWBXAH/UIKit.pcm' was built
note: after modifying system headers, please delete the module cache at '/Users/rashidasgari/Library/Developer/Xcode/DerivedData/ModuleCache/SWBH8ZAWBXAH'

I tried any solution i could find and still no luck. Note that i tried running the application on another MacBook and everything works fine without any errors.

我尝试了我能找到的任何解决方案,但仍然没有运气。请注意,我尝试在另一台 MacBook 上运行该应用程序,一切正常,没有任何错误。

采纳答案by Rashid

Ok after trying almost every solution on web, i decided to reinstall xcode and it finally worked.

好吧,在尝试了几乎所有网络解决方案之后,我决定重新安装 xcode,它终于奏效了。

回答by Wain

Cleaning the project is the first port of call (menu under Product).

清理项目是第一个停靠点(下的菜单Product)。

If that doesn't help, delete the derived data. That can be done via the Locationssection of the preferences or by navigating to the directory in Finder and deleting it (there is a little ->button in preferences to get there, or use Go To Folder...option in the Finder.

如果这没有帮助,请删除派生数据。这可以通过Locations首选项部分或通过导航到 Finder 中的目录并删除它来完成(->首选项中有一个小按钮可以到达那里,或者使用Go To Folder...Finder 中的选项。

回答by Narasimha Nallamsetty

I solved this problem by changing DerivedData folder name..see how i did

我通过更改 DerivedData 文件夹名称解决了这个问题..看看我是怎么做的

Xcode->preferences->Then you will be redirected to preferences screen

Xcode->preferences-> 然后你将被重定向到首选项屏幕

Then click on locations tab under menu selection->then you will have options like Derived data,snap shots ,archives

然后单击菜单选择下的位置选项卡-> 然后您将拥有衍生数据、快照、档案等选项

under Derived data you can see some thing like /Users/SENABI/Library/Developer/Xcode/DerivedData-> then click on that arrow button that's it there you can see DerivedData folder click on that and rename it. your error will be removed. This is my experience and it worked for me hope it will be helpful to someone.

在派生数据下,您可以看到诸如 /Users/SENABI/Library/Developer/Xcode/DerivedData-> 之类的内容,然后单击该箭头按钮在那里,您可以看到 DerivedData 文件夹单击它并重命名它。您的错误将被删除。这是我的经验,它对我有用,希望对某人有所帮助。

回答by Nagaraj

Error occurs when system header files are modified.

修改系统头文件时发生错误。

Solution :

解决方案 :

  • If you have the backup of XCode then reinstall the XCode (Better solution).
  • Delete the DerivedData folder and then build the project
  • 如果您有 XCode 的备份,则重新安装 XCode(更好的解决方案)。
  • 删除 DerivedData 文件夹,然后构建项目

回答by user3058056

you don't have to delete anything. you messed up a git pull somewhere probably. just quit Xcode and the simulator, reset any changes (or stash them) try another git pull, start Xcode again, clean your project and run it again.

你不必删除任何东西。你可能在某个地方搞砸了 git pull。只需退出 Xcode 和模拟器,重置任何更改(或隐藏它们)尝试另一个 git pull,再次启动 Xcode,清理您的项目并再次运行它。

回答by Abhinav

Use CMD+Shift+K to clean the build and then relaunch. This should solve the issue.

使用 CMD+Shift+K 清理构建,然后重新启动。这应该可以解决问题。