Xcode build fails with "fatal error: malformed or corrupted AST file" Crashlytics.h
First, try going to Product -> Clean menu in Xcode. Then rebuild when it finishes.
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).
Good luck! Love it when Xcode goes weird like this :)
I hit this issue after updating my version of Xcode via the Mac App Store.
After updating Xcode, the xcode-select
Command Line Tools version of Xcode was still set to the old version. This was creating some kind of mismatch in xcodebuild
.
I solved the issue like so:
Xcode > Preferences > Command Line Tools
. Select the newest Xcode version.- Quit Xcode
- Delete the
~/Library/Developer/Xcode/DerivedData
directory. - Run build script again. Success!
For SEO purposes, when I was hitting this issue I saw the following errors:
error: InputFile /Users/user/source/Your-PCH-Prefix.pch 0 1406772618 191 33188... malformed line 9; 'InputFile' should have exactly five arguments
Also:
xcodebuild[53039:5503] stream error: stream error at offset 29: created by an unsupported XCDependencyGraph buildxcodebuild[53039:4e0b] stream error: stream error at offset 29: created by an unsupported XCDependencyGraph build** BUILD FAILED **The following build commands failed: Write auxiliary files MappingModelCompile