iOS SDK broken ever after reinstall UIKit and Foundation frameworks not found

≯℡__Kan透↙ 提交于 2019-11-28 01:25:56

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.

Yuriy Polezhayev

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).

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.

Radu Ursache

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)

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.

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