Xcode构建失败,并显示“严重错误:AST文件格式错误或损坏”。 Crashlytics网站 [英] Xcode build fails with "fatal error: malformed or corrupted AST file" Crashlytics.h

查看:103
本文介绍了Xcode构建失败,并显示“严重错误:AST文件格式错误或损坏”。 Crashlytics网站的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近在我的Xcode项目构建设置中启用了模块(启用模块(C和Objective-C)),现在我经常遇到以下构建错误。下次我构建时它可以工作(不做任何更改),但是很烦人,因为它经常发生(一个小时几次)。

I recently enabled modules in my Xcode project build settings ("Enable Modules (C and Objective-C)") and now I frequently get the below build error. It works the next time I build (without any changes) but it is annoying because it happens very often (several times an hour).


致命错误:AST文件格式错误或损坏:'找不到文件
'/Users/mpv/dev/project/Crashlytics.framework/Headers/Crashlytics.h'AST文件引用的
'注意:之后修改系统标题,请
删除
中的模块缓存'/ Users / mpv / Library / Developer / Xcode / DerivedData / ModuleCache / M5WJ0FYE7N06'

fatal error: malformed or corrupted AST file: 'could not find file '/Users/mpv/dev/project/Crashlytics.framework/Headers/Crashlytics.h' referenced by AST file' note: after modifying system headers, please delete the module cache at '/Users/mpv/Library/Developer/Xcode/DerivedData/ModuleCache/M5WJ0FYE7N06'

Crashlytics建议从预编译的头文件(.pch)中删除Crashlytics.h,并直接导入需要它的每个源文件中。这大大减少了问题,但是在构建时我仍然偶尔会出现Crashlytics.h文件未找到错误。

Crashlytics recommended removing Crashlytics.h from the precompiled header file (.pch) and importing directly in each source file that needs it. This greatly reduces the problem but I still occasionally get a Crashlytics.h file not found error when building.

fatal error: 'Crashlytics/Crashlytics.h' file not found
#import <Crashlytics/Crashlytics.h>


推荐答案

首先,尝试进入产品->清洁菜单Xcode。然后在完成时进行重建。

First, try going to Product -> Clean menu in Xcode. Then rebuild when it finishes.

如果这不起作用,请转到支持文件文件夹中的[Name] -Prefix.pch文件,并删除#import行。建立。它会出现错误,可以,现在再次开始输入,并确保从下拉建议菜单中选择正确的选项,以便它自动为您填充行的其余部分。 (这一步对我有用)。

If that doesn't work, go to your [Name]-Prefix.pch file in the Supporting Files folder, and delete the #import line. Build. It will have errors, it's ok, now start typing it again and make sure to select the right choice from the drop-down suggest menu so it auto-fills the rest of the line for you. (This step worked for me).

祝您好运!当Xcode像这样怪异时爱它:)

Good luck! Love it when Xcode goes weird like this :)

这篇关于Xcode构建失败,并显示“严重错误:AST文件格式错误或损坏”。 Crashlytics网站的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆