Parse error "Could not build module 'UIKit'" but the app runs fine - ios

I created a new project in Xcode 11, the "Single View app" in objective C. In every class the line #import <UIKit/UIKit.h> is highlighted in red, with the message "Could not build module 'UIKit.'" However the app builds and runs with no problem.
I've read a lot of questions like this on SO from years back, but none with XCode 11 and it doesn't sound like any of them would build without breaking. For me it is purely a parsing issue.
I tried deleting derived data, and I reinstalled XCode multiple times. The last time I went through this tutorial for completely erasing XCode from my computer: https://macpaw.com/how-to/uninstall-xcode-on-macos
Through the rest of the day the issue seemed to be gone. But this morning it's back again.
This seems to be happening with any XCode project I have, including brand new ones with no code changes.
I would just ignore the "errors" but it keeps me from being able to use autocomplete which slows down my workflow a lot.
Update
This issue seems to have gone away. I'm not sure why but I'm happy for it.
Update
This issue came back again after updating my computer. I have not been able to update Xcode for a while not. I'm not sure if the issue is related
Update
I was able to update Xcode, and the issue went away again.

I updated my Mac to Catalina 10.15.1 and was able to update Xcode to 11.2. After this the parse error discontinued and all of my syntax highlighting is back to normal.

Related

Xcode 10 it constantly is crashing with no errors

I installed Xcode 10 but keeps on crashing sometimes it crash the moment is loading a project or playground but is not showing any error it all. Any of you are experience this issue and if you have had how did you fixed?
I'll really appreciate your help.
This issue is getting because of Mac OS update
if you are using GitLab, Please reclone project repository.
After reclone application will working fine.
Clear all derived data and empty trash before opening project.

Why Xcode shows "This app could not be installed at this time." pop-up?

When I run the project and add the app in simulator for the first time, everything is okay. But when I run it again, Xcode prompts this message as a pop-up window at the end of compilation:
This app could not be installed at this time.
I already checked the relevant question, and tried all the advised ways to solve this issue; checking mentioned logs, cleaning project, restarting simulator, changing it, erasing all content and settings in it. Nothing works. I must erase the app and recompile it every time to open the app. Did you get the same message before? Is there any way to detect problem and resolve it? Btw, I use Xcode 9.2 at High Sierra.
This error pop-up may come up for different reasons. There is no specific reason to see it for now. In my case, a JSON file that I added to Bundle in order to provide mock data triggered this issue. This file was containing a Turkish letter in one of the keys. After I fix it, the pop-up is gone. Interestingly, earlier simulators (<=9.1) work properly if JSON file contains Turkish letter but 9.2 simulators cannot tolerate it.
Worked for me when I rebuild the project after deleting the derived data folder.
I think I may have found a solution. This all started a short time after I let Xcode update my project settings. Specifically on my CocoaPod-Subproject. I removed the pods and reinstalled them and now I am no longer getting the pop-up.

Xcode 8.2.1 quits unexpectedly every time when I open my project

I'm getting an error Xcode 8.2.1 quit unexpectedly whenever Xcode is opened. This was working fine till last night. I have tried restart system but didn't worked.I have updated mac OS with macOS Sierra (version 10.12.3).
I already deleted derived data from preferences but it's not working for me.
please tell me why its happening like this...Thanks a lot in advance...
I've had this situation before.
My solution is that:
quit Xcode clearly
open other no question project or create a new project
open the your project again which will quit unexpectedly
it's maybe Xcode's bug, this is work to me, hope it's work to you too!
That state information might have become corrupted.
Follow these steps hope it will help you
1.) Right click on your project.
2.) Choose package content.
3.) Delete all extra files except project.pbxproj
4.) Come back to your project.
5.) Run

Xcode, iOS, "Stop "(null)", "An instance of "(null)" is already running..."

Xcode 7.2.1, iOS 9.2.1, ARC enabled
Sometimes when I am quickly building and running a project in Xcode back to back I get this error:
Xcode still thinks that it is still running an instance of my application on the device, however, the application has long since been terminated.
When I click "Stop" it just hangs up and looks like this...
I have tried waiting for 5 minutes, but the error does not clear and the status does not update to indicate that the application stopped running.
The only solution is to restart Xcode. This ends up being a huge hassle, because I have to navigate back to where I was and open all the necessary windows again.
Does anyone have an alternative way of handling this error?
It seems to occur when I intermix using the stop button with using the short cut to run the project (⌘ + R).
Much thanks in advance.
UPDATE 2/23/2016
I noticed that when I unplug and plug the cable back in after the error occurs the project allows a new build and instance to run, but the old instance never goes away, so you end up with multiple "running" projects.
Does anyone know how to get rid of that? Or add to the original solution?
1st Solution :
Technique 1- Clean your project , and then build.
Technique 2- Quit your Xcode, Clear your derived Data , plug In you
Data Cable Again , Then Run your Project.
2nd Solution (Happened For me too) :
Change Your Data Cable.

Xcode does not run the app on simulator. (App exited unexpectedly)

I'm developing for iPad (iOS 7), using Xcode 5.0.2.
Yesterday morning I was playing around with the app (my first app) and every time I ran it, it was displayed in the emulator perfectly. But after some 5/6 runs Xcode just stopped launching my app in the simulator. I started to receive this message:
MagazineManager exited unexpectedly - lost connection
Image:
I've been researching since yesterday morning for a solution with no luck. I even uninstalled and reinstalled Xcode, cleared the cache, delete folders... all that drama thinking it could be some sort of cache problem.
Then, going online I've tried lots of "solutions", none worked.
I've tried all listed here: Xcode suddenly stopped running project on hardware: "Could not launch xxx.app: .. No such file.."
and here:https://discussions.apple.com/message/23431537#23431537
and in more places.
After all my "try this, try that" I'm stuck with the same problem. I can only see a black screen at the simulator (image below) and that message at Xcode!
In my extensive research I've read that people are still able to debug using their iPad's. The problem is that I got the new iPad air, that's only getting here dec, 20th!! So I don't have a place to test my app[s].
Thanks!
UPDATE
Just got this message in the debugger console:
013-12-09 20:23:25.902 sim[607:303] /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/usr/bin/sim: Did not find an executable file at the path: '/Users//Library/Developer/Xcode/DerivedData/MagMan-bvhhiijesvrvuteunbmpsxcqgsst/Build/Products/Debug-iphonesimulator/MagMan.app'
My problem was the debugger. Actually, it still is.
The way I solved, and have been doing for every new project, was to disable the debugger and then run the project. That way I'm able to use the app on the simulator but without the debugging functionality.
I don't know what the problem is, what is causing this debugger issue in my case, but for now that's the best I could come up with. Thanks to the friends that replied to my question and helped my research I was able to test it and disable it.
This is how I disabled the debugger:
Project > Edit scheme
Set Debugger to None
If anyone knows a solution for this, feel free to answer this question and I'll make sure to update the selected answer accordingly.
Again, thanks for all your time and patience, specially #Popeye and #HotLicks that spent a lot of their time trying to help me.
Sometimes the simulator can be a bit flaky and just needs resetting. In the navigation bar at the top of the screen when the simulator is visible try:
iOS Simulator --> Reset Content and Settings...
This should reset all the settings and remove the content so all data, images, apps etc will be removed, its like it has never run before.
UPDATE
The answer on XCode5 can't install app on iOS simulator indicates the following
I found a "Fix" for this. After trying everything and getting the same error on "My App", I opened and tried to run "My App 2". "My App 2" ran fine, so I went back to "My App", tried again and this time everything worked fine. Crazy
If that doesn't work leave a comment and I will have another look.
Delete the app and restart your iPad it will work

Resources