AST文件格式错误或损坏 [英] Malformed or corrupted AST file
问题描述
我有一个问题我不知道为什么它首先发生,但最可能的原因是因为我错误地将一些系统框架转移到垃圾箱。
I have a problem I don't know why did it happen in the first place but most probably because I've pressed move to trash to some system frameworks by mistake.
我收到一条错误消息:
AST文件格式错误或损坏: '找不到文件'/Users/username/myProject/QuartzCore.framework/Headers/CAMediaTiming.h'由AST文件引用'
malformed or corrupted AST file: 'could not find file '/Users/username/myProject/QuartzCore.framework/Headers/CAMediaTiming.h' referenced by AST file'
我试图在该目录中复制QuartzCore.framework。它给了我一些新的错误。然后,如果我从Dir中删除框架。在我做任何代码更改之前,一切都会对项目有益。然后我将不得不重新制作上一个场景。现在非常烦人,我真的需要解决这个问题。任何人?
I've tried to copy QuartzCore.framework in that Directory. It give me then a punch of new errors. Then if I remove the framework from the Dir. Everything will be good for the project till I make any code change. Then I would have to make the previous scenario again. It's very annoying now and I really need to fix this. Anyone?
推荐答案
按要求:
导致此错误的原因是什么我(在获得新的Xcode之后)是我会尝试在模拟器中运行一个项目(偶然在模拟器中,我从不使用模拟器),但我忘了选择我的设备或我的设备将被拔掉而没有我注意到,它将尝试在模拟器中运行...所以我会得到那些经典的.o文件错误...然后我会切换回我的设备并获得损坏的AST文件......
What caused this error for me (after getting the new Xcode) was I would try to run a project in simulator (accidentally in simulator, I never use simulator), but I'd forget to select my device or my device would become unplugged without me noticing, and it will try to run in simulator... so I would get those classic ".o" file errors... Then I would switch back to my device and get corrupt AST files...
要解决问题...(请按照以下步骤 非常 密切关注!!!!!)
To CURE the problem... (Follow the steps below VERY closely!!!!!)
- 清理项目
- QUIT Xcode(CMD + Q)
- 运行此终端命令:
rm -rf~ / Library / Developer / Xcode / DerivedData / ModuleCache / *
- 重新打开Xcode
- 确认您选择的设备而不是模拟器
- 清洁项目( 是,agai n )
- 那么构建(对您的设备, 不是模拟器 )......
- Clean your project
- QUIT Xcode (CMD+Q)
- Run this Terminal Command:
rm -rf ~/Library/Developer/Xcode/DerivedData/ModuleCache/*
- Reopen Xcode
- MAKE SURE YOU HAVE YOUR DEVICE SELECTED AND NOT SIMULATOR
- CLEAN project (Yes, again)
- THEN build (to your device, not to simulator)...
享受!
Enjoy!
注意:经过进一步的实验,我发现xCode的强制退出可能不是必需的。
这篇关于AST文件格式错误或损坏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!