Malformed or corrupted AST file

前端 未结 7 2083
隐瞒了意图╮
隐瞒了意图╮ 2021-01-30 10:32

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.

I got an

7条回答
  •  别那么骄傲
    2021-01-30 11:25

    As requested:

    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. Clean your project
    2. QUIT Xcode (CMD+Q)
    3. Run this Terminal Command:
      rm -rf ~/Library/Developer/Xcode/DerivedData/ModuleCache/*
    4. Run this Terminal Command:
      rm -rf ~/Library/Developer/Xcode/DerivedData/ModuleCache.noindex/*
    5. Reopen Xcode
    6. MAKE SURE YOU HAVE YOUR DEVICE SELECTED AND NOT SIMULATOR
    7. CLEAN project (Yes, again)
    8. THEN build (to your device, not to simulator)...

    Enjoy!

    Note: After further experimentation I've found that the force-quitting of xCode is possibly not necessary.

提交回复
热议问题