iOS SDK broken ever after reinstall UIKit and Foundation frameworks not found
For the pch file I get these errors:
/Users/matt/Programming/iPhone Monkey Curling lite/iPhone_Monkey_Curling_Prefix.pch:6:34: error: Foundation/Foundation.h: No suc开发者_StackOverflow社区h file or directory
/Users/matt/Programming/iPhone Monkey Curling lite/iPhone_Monkey_Curling_Prefix.pch:7:24: error: UIKit/UIKit.h: No such file or directory
Here's the file as it is by default:
//
// Prefix header for all source files of the 'iPhone Monkey Curling' target in the 'iPhone Monkey Curling' project
//
#ifdef __OBJC__
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#endif
I reinstalled Xcode and the iOS SDK but that did not fix the problem. This problem occurred after adding the iAd framework to one of my projects but all of my projects won't compile.
I'm using the latest SDK (4.1).
The frameworks are there in the project. For some reason, when I try to add a new framework, it lists the OS X ones in an iOS project.
Thank you for any help.
On the Apple developer forums I managed to get help on pin-pointing the issue. It turns out somehow a build option was set to something odd.
It was the "Framework Search Paths" option. Make sure this is empty if anyone has a similar problem.
I'd like to add to the Matthew's answer:
Actually, the Framework Search Paths shouldn't be empty, but it should include only the paths to the SDK's Frameworks folders. In my case simulator worked with this path:
/Applications/Xcode.app/Contents/Developer/Platforms/_**iPhoneSimulator.platform**_/Developer/SDKs/iPhoneOS6.0.sdk/System/Library/Frameworks/
and device started working when I added this one:
/Applications/Xcode.app/Contents/Developer/Platforms/_**iPhoneOS.platform**_/Developer/SDKs/iPhoneOS6.0.sdk/System/Library/Frameworks/
Thi is for XCode Version 4.5.1 (4G1004).
Check to make sure it's not a typo. Have had multiple dependencies misspell UIKit
with a capital I
like this:
#import <UIKit/UIKIt.h> // typo
#import <UIKit/UIKit.h> // correct
Just check the import carefully and make sure.
This happened for me in xcode 4, it would build fine for debug but not release. Similar to your fix, the prefix header for release was pointing to UIKit.h instead of my .pch file.
This happened to me. I am not very good with the Mac's "Finder." It doesn't work quite the same as Windows Explorer. I was wanting to add a couple of image files to my project, and navigating my way to the folder I accidentally double-clicked on the Developer folder, which added over 8,500 files to my project. Thinking it would be sufficient to just remove the folder from my project, I didn't know that it would change search paths. It did, and in fact, it also change my Library search path. Deleted both, and I'm good again. But not before a great deal of emotional agony.
I add this only to let people know how the problem cropped up for me. Something like that is insidiously easy.
got this problem with xcode 5 (developer preview). i tried everything, including these answers - Availability.h, UIKit.h, etc not found but nothing works.
my fix was reinstalling xcode (downloading again from developer portal and replace the old one)
精彩评论