Availability.h, UIKit.h, etc. Not found

I have a big problem here.

I recently downloaded Xcode 4.3 from the Mac App Store because it had a full-screen feature for Lion. And then my project stopped compiling. It says:

Lexical or Preprocessor Availability.h error not found.

 // // Prefix header for all source files of the 'TRGame' target in the 'TRGame' project // #import <Availability.h> #ifndef __IPHONE_3_0 #warning "This project uses features only available in iPhone SDK 3.0 and later." #endif #ifdef __OBJC__ #import <UIKit/UIKit.h> #import <Foundation/Foundation.h> #endif 

This is in the xxxx-Prefix.pch .

If I comment on #import Availability.h , it will tell me that it cannot find UIKit.h and so on ...

Help will be very high!

+6
source share
12 answers

I hate this problem! There seems to be a simple solution that SOMETIMES works:

Possible Solution

Go to "Build Phases" → "Linking Binary Files to Libraries".

If you have a problem with say Foundation.framework. Just delete it i.e. Use the minus button ("-") at the bottom of the list.

And then add it again using the plus button.

Empty the build folder. (To do this, hold down the ALT key, then click “Product”> “Clear.” In “Clear Assembly” you will see “Clean” changes).

Another possible solution

Be sure to read Matthew's answer here ...

iOS SDK broken after reinstalling UIKit and Foundation databases not found

Look at the meaning of your "Search Paths Framework."

Another possible solution

Uninstall Xcode 4.3 completely and completely, use "CleanMyMac" (it will try to find every related component of the application that you are trying to uninstall).

Then just use the App Store to (re) install Xcode. As David mentions, this can sometimes fix this damned problem.

Why is this happening?...

I believe this problem can occur in situations where you, say, replaced your hard drive (i.e., probably using Cloner Carbon Copy Cloner or the like) or in some way the main volume on your Mac is renamed or changes in some way. I think that a small error may occur in the new Xcode "application-style", where it sometimes makes, and sometimes does not understand, such changes in the paths.

I hope this helps someone!

This is a causeless problem. I simply repeated this in this case, because subsequently I deleted a copy of the “old-style X-code” from the machine. (It might be best to remove the old-style XCodes (developer directory, etc.) before installing the new-style Xcode.)

+16
source

I also had a problem, Xcode 4.3 could not find Foundation.framework, CoreFoundation.framework and, as David Da Silva Contín said , I uninstalled Xcode 4.3 build 4E109, which was installed on top of Xcode 4.2 and installed it again, and now everything is fine . Thanks David = D

+1
source

I am trying to uninstall and reinstall Xcode. Thanks.

+1
source

I had a similar problem.

I added one of my own .h files to .pch , so I did not have to import it into each class. It was perfect, so far only now, when I started to get errors, but only when creating the device. The strange thing is that it is still installed and working fine on the device, and there were no errors at all on the simulator.

That’s all . I did the removal of the import line from .pch , cmd + S, and then hit the heels three times three times and added it back.

I made the + clean option and then compiled it without any problems. I am very glad that you do not need to reinstall Xcode and perhaps this will help someone else?

+1
source

Maybe in the build settings → The actual architecture is arm64. So just remove the arm64 architecture and solve the problem.

+1
source

Answer Ivan

Make sure that "Use standard search in the system directory" (in the "Build Settings" section) is set to Yes .

For me, "Use standard search in the system header" is already set to "YES", but I marked it NO , and then returned to YES strong> and made both a clean and a clean build folder ( Product → Clean and (ALT) Product → Clean Build Folder ) which seems to have solved the problem for me.

Now I'm not sure which steps in this process really fixed (I cleared the build folder to no avail), but it worked.

+1
source

UIKit is not for Lion, but limited to iOS. Is your project targeting an iOS SDK?

0
source

I solved this by simply reinstalling Xcode.

If something similar is happening to you, uninstall Xcode.app (as it is just an app now) and download it again from the Mac App Store.

I think he did not install correctly.

0
source

Try reinstalling Xcode. I lost a lot of time when I was looking for a problem. Then I tried reinstalling my Xcode because I could not see the header files in each structure. And it helped me.

0
source

Make sure that " Use standard search in the system directory " (in the "Build Settings" section) is set to Yes .

I accidentally changed this setting and had the same problem.

0
source

Having completely deleted the project and added everything again, I worked several times.

0
source

I had the same problem after I cloned my old computer to a new one with the migration assistant.

I solved it simply by deleting the contents of the DerivedData folder (/ Users / userName / Library / Developer / Xcode / DerivedData).

I think a clean uninstall or install a new version of xCode does the same.

0
source

Source: https://habr.com/ru/post/908986/


All Articles