格式错误或损坏的 AST 文件

2023-05-18移动开发问题
4

本文介绍了格式错误或损坏的 AST 文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

限时送ChatGPT账号..

我有一个问题,我一开始不知道为什么会这样,但很可能是因为我错误地按下了移动到垃圾箱到某些系统框架.

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 文件:'找不到 AST 文件引用的文件'/Users/username/myProject/QuartzCore.framework/Headers/CAMediaTiming.h' '

malformed or corrupted AST file: 'could not find file '/Users/username/myProject/QuartzCore.framework/Headers/CAMediaTiming.h' referenced by AST file'

我尝试在该目录中复制 QuartzCore.framework.然后它给了我一些新的错误.然后,如果我从目录中删除框架.在我进行任何代码更改之前,一切都会对项目有利.然后我将不得不再次制作以前的场景.现在很烦人,我真的需要解决这个问题.有人吗?

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!!!!!)

  1. 清理您的项目
  2. 退出 Xcode (CMD+Q)
  3. 运行此终端命令:
    rm -rf ~/Library/Developer/Xcode/DerivedData/ModuleCache/*
  4. 运行此终端命令:
    rm -rf ~/Library/Developer/Xcode/DerivedData/ModuleCache.noindex/*
  5. 重新打开 Xcode
  6. 确保您选择了您的设备,而不是模拟器
  7. CLEAN 项目(是的,再次)
  8. 然后构建(到您的设备,不是模拟器)...

<小时>

享受吧!


Enjoy!

注意:经过进一步实验,我发现强制退出 xCode 可能没有必要.

这篇关于格式错误或损坏的 AST 文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

The End

相关推荐

硬件音量按钮更改应用程序音量
Hardware Volume buttons change in app volume(硬件音量按钮更改应用程序音量)...
2024-08-12 移动开发问题
10

恢复游戏 cocos2d
Resume game cocos2d(恢复游戏 cocos2d)...
2024-08-12 移动开发问题
6

突出显示朗读文本(在 iPhone 的故事书类型应用程序中)
Highlight Read-Along Text (in a storybook type app for iPhone)(突出显示朗读文本(在 iPhone 的故事书类型应用程序中))...
2024-08-12 移动开发问题
9

Cocos2D + 仅禁用 Retina iPad 图形
Cocos2D + Disabling only Retina iPad Graphics(Cocos2D + 仅禁用 Retina iPad 图形)...
2024-08-12 移动开发问题
10

[ios.cocos2d+box2d]如何禁用自动旋转?
[ios.cocos2d+box2d]how to disable auto-rotation?([ios.cocos2d+box2d]如何禁用自动旋转?)...
2024-08-12 移动开发问题
7

从 Documents 目录存储和读取文件 iOS 5
Storing and reading files from Documents directory iOS 5(从 Documents 目录存储和读取文件 iOS 5)...
2024-08-12 移动开发问题
9