Xcode 5 error: “Malformed or corrupted AST file: mismatched umbrella header in submodule”

北城余情 提交于 2019-12-12 12:34:41

问题


After adding StoreKit to my Xcode 5 project, I now see...

"Malformed or corrupted AST file: mismatched umbrella header in submodule"

...whenever I've imported any header from StoreKit. I haven't changed those system headers, and clearing derived data and the usual Clean Build Folder fix doesn't work either, nor does restarting Xcode change anything.

I see in the Clang sources where the error is being reported, but I can't tell why. Here's the relevant Clang code from http://clang.llvm.org/doxygen/ASTReader_8cpp_source.html:

case SUBMODULE_UMBRELLA_HEADER: {
03728       if (First) {
03729         Error("missing submodule metadata record at beginning of block");
03730         return true;
03731       }
03732 
03733       if (!CurrentModule)
03734         break;
03735       
03736       if (const FileEntry *Umbrella = PP.getFileManager().getFile(Blob)) {
03737         if (!CurrentModule->getUmbrellaHeader())
03738           ModMap.setUmbrellaHeader(CurrentModule, Umbrella);
03739         else if (CurrentModule->getUmbrellaHeader() != Umbrella) {
03740          Error("mismatched umbrella headers in submodule");
03741           return true;
03742         }
03743       }
03744       break;
03745     }

It evidently compares my imported umbrella header

#import <StoreKit/StoreKit.h>

to something else, but I can't determine what that something else is.

Has anyone else encountered this, and hopefully found a way to resolve it?


回答1:


I was able to encounter this problem, following the direction mentioned by John above doesn't work for me. I was able to solve this problem by doing the following:

  • close all open XCode projects.
  • Delete all the folders inside Derived Data folder.

How to go to Derived Data folder? just right click on your Product build and show finder, browse through the hierarchy of folders and look for Derived Data.

Hope this helps. This seems to be a bug in Xcode? but not sure.




回答2:


This solved it for me:

  1. go to project build settings
  2. scroll down to LLVM 5.1 Language Modules
  3. set Enable Modules (C and Obj C) to NO



回答3:


In Xcode go to Window->Organizer->Projects select your project and press delete button next to Derived data. Just did it (and it worked) with information the following question:

fatal error: malformed or corrupted AST file - Xcode




回答4:


In your Project folder there would be couple of folders named Derived Data and build. Just remove those folders and the problem would be resolved. These folders get created automatically once you open your XCode.



来源:https://stackoverflow.com/questions/20596914/xcode-5-error-malformed-or-corrupted-ast-file-mismatched-umbrella-header-in-s

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!