I made a single view app for the ipad, with a movie, webview and button, and I get this error when I try and run it. I have restarted the application, and reinstalled it, but nothing is working. This error keeps coming up in my MoviePlayer_Prefix.pch file. Can someone help me out?
-
Possible solution for anyone looking: https://stackoverflow.com/a/56794987/868193 – Beltalowda Jun 27 '19 at 16:22
4 Answers
I have had the same issue with being unable to compile project due to UIKit.h not being found + "unable to load standard library for target..."
The solution for me was very simple - to quit (CMD+Q) and relaunch Xcode. I have found out that with Xcode opened, macOS seems to have removed command line tools for Xcode because it was preparing for a update and relaunching Xcode triggered the "install additional components" update and it made the problem disappear.

- 516
- 5
- 7
-
Agree. This can happen when you have XCODE set to update automatically and then you try an run your app. – tdios Jan 27 '21 at 15:56
-
Like Faul Textor said, most likely your XCode updated to 12.1 but your Command Line Tools didn't. You need to quit XCode completely and then start it again and you should get a pop-up saying "Install Additional Components" Sorry, this should have been a comment to his reply but I cannot do that.

- 4,698
- 1
- 33
- 54

- 101
- 1
- 2
-
2
-
@ReimondHill Ha, this literally just happened to me too (5 hours after your comment)! Sounds like an xcode-wide update may be going on. This is def gonna cause some irritations. tl;dr - just close Xcode, you may be prompted to install additional components, do so, and that should fix your issue. – Aaron Krauss Nov 13 '20 at 18:01
It sounds like you removed the UIKit.framework from your project at some point. Check if it is listed in your project navigator. If it's not there, go to your project in the project navigator pane, select your target, go to the build phases tab, click on link binary with libraries, hit the plus button, find the UIKit.framework there and add it to your project.
EDIT: This answer suggests that there mayb be an issue with your framework search paths build setting. Check that out and if the path is empty and it still doesn't work, a re-install of Xcode would fix it, I think.

- 1
- 1

- 4,123
- 1
- 23
- 35
-
1That's the weird part. It is in my navigation bar. I have tried going into the link binary with libraries tab, and taken it out and added it, but it still doesn't work. I can't think of anything else to do. – Chandler De Angelis May 18 '12 at 19:49
-
I just tried staring another project and the same error showed up. Maybe I deleted something important? – Chandler De Angelis May 18 '12 at 19:53
-
2Did you use a software called CleanMyMac? Your issue happened to me twice after I used CleanMyMac to clean up the disk, apparently CleanMyMac got rid of the Cocoa/CocoaTouch frameworks files. – Chris Chen Sep 29 '12 at 13:50
-
Just wanted to add my two cents on not making a dumb-ass mistake - came across this answer hoping to solve same problem.
Turns out I had written #import "<UIKit/UIKit.h>"
instead of #import <UIKit/UIKit.h>
.
Thought I would add in case someone else makes a simple mistake like me.

- 29,441
- 10
- 93
- 100

- 1,006
- 4
- 12
- 20