Xcode Won't Compile To Simulator

2019-05-05 11:16发布

问题:

I've just updated Xcode 4.5 via the App Store, from my previous version which I got from my Apple Developer Account. Since the update I can't compile any apps into the Simulator. I can compile onto a device, e.g. my iPhone.

The error I recieve is

    fatal error: file 
    '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/
Developer/SDKs/iPhoneSimulator6.0.sdk/usr/include/Availability.h'
         has been modified since the precompiled header was built

1 error generated.

回答1:

go in ~/Library/Developer/Xcode/DerivedData/{project name + gobly-gook} and delete folder with your project name.

EDIT After suggestion

NOTE:

By default Library Folder is hidden so we can't see it.
So we have three way to use this hidden ~/Library folder

1.Unhide Library folder by following command to unhide ~/Library folder

chflags nohidden ~/Library

Now you can see Library folder as /Users//Library

2. Open GO menu of finder and press Alt key and Library will be visible as new menu item.
Select that to open Library folder

3. You can access ~/Library folder by Terminal.



回答2:

There's easiest way: Just "clean" project (Product > Clean)



回答3:

You can just open the Organizer (top-right corner of XCode), go to the Projects tab, select your project on the left and then delete the Derived Data.



回答4:

This happened when I updated Xcode from 6.0.1 to 6.1

I cleaned the project and could compile successfully!!