macaroon
macaroon

Reputation: 31

Tried to restore xcode 5 project from backup and now get a fatal error

Tried to restore xcode 5 project from backup because something I added to the app wasn't working and now get a fatal error.

I have no idea how to fix this, first I got this msg:

fatal error: file '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIViewController.h' has been modified since the precompiled header '/Users/Mallory/Library/Developer/Xcode/DerivedData/ModuleCache/29VIL2542Q0C1/UIKit.pcm' was built note: after modifying system headers, please delete the module cache at '/Users/Mallory/Library/Developer/Xcode/DerivedData/ModuleCache/29VIL2542Q0C1' 1 error generated.

I tried to fix the UIViewController.h file (I had changed the permissions of it before so changed them back) and renamed Module cache (instead of deleting it, just in case). Then I got this error:

fatal error: malformed or corrupted AST file: 'Unable to load module "/Users/Mallory/Library/Developer/Xcode/DerivedData/ModuleCache/29VIL2542Q0C1/Darwin.pcm": file not found' note: after modifying system headers, please delete the module cache at '/Users/Mallory/Library/Developer/Xcode/DerivedData/ModuleCache/29VIL2542Q0C1' 1 error generated.

Any idea how to fix this?

Upvotes: 2

Views: 1886

Answers (1)

Daniel Larsson
Daniel Larsson

Reputation: 6394

I would try to:

  • Clean the project
  • Touch the project's .pch file
  • Perform a deep clean (Option+Command+Shift+K)
  • iOS Simulator > Reset Content and Settings

I would also try to delete the module cache in /var/folders, here is a neat ruby script for clearing both that and derived data:

derivedDataFolder = Dir.glob(Dir.home + "/Library/Developer/Xcode/DerivedData/*")
moduleCache = Dir.glob("/var/folders/**/com.apple.DeveloperTools*")
FileUtils.rm_rf derivedDataFolder + moduleCache

If it still does not work, a reinstall of Xcode could do the trick.

Upvotes: 7

Related Questions