xcode doesn't show compiler errors in code

When working in Xcode and deliberatly making errors in my code (using Swift 2) (e.g. using undefined variables, wrong type casts, ...), Xcode doesn't seem to show compiler errors in my code.


I included a screenshot of some code I wrote in a playground, executed on my computer, and the same code a friend of mine executed on his:

mine (the output on the left is output before I made the error, it just didn't update after my alterations)

friend's


I hope someone can help me since this is becoming rather annoying,


Thanks!

You should submit a bug report about this, especially if you can include a project that shows the problem.


Here are no solutions, but 4 things to look at:


1. Sometimes Xcode is just very, very slow in getting error messages to the editor pane. They may show up eventually.


2. Sometimes Xcode gets confused about which target or build it's showing error messages for. (If you switch targets, existing error messages should be preserved but hidden until you return the same target.) This may prevent it from showing the errors you want.


3. If SourceKit is crashing, you probably won't see any in-editor messages until it comes back.


4. Sometimes it's just easier to force Xcode to compile the file you're looking at. You can do this from the menu: Product -> Perform Action -> Compile. This almost always gets you the error messages almost at once. 😉 I have this mapped to Command-K because I use it so often.


(I'm using Xcode 7.1.1. Results with other versions may vary.)

I know this is an old thread but I wanted to leave an answer as I didn't find anything anywhere else. My problem was that Xcode (v8.2.1) was not showing me the current compliation errors but was showing old ones for code that I'd deleted.


I looked in the logs for the the build process and found reference to where Xcode places temporary/derived files. I figured it must be caused by state in a file since the problem was persisting even when I restarted Xcode and after I had run a "clean".


Xcode keeps derived files in this location (at least for me) :

~/Library/Developer/Xcode/DerivedData


There will be a directory per project. Rather than looking for the exact part holding this bad state, I simply, quit Xcode, deleted the entire directory for my project and then restarted Xcode.


That seemed to sort it out. Hope this is useful for someone. 🙂

I have what I believe is the same problem... I have buildtime errors in my playground code and they appear as such in the Issue Navigator, in the Debug Console, and even in the error count icon in the Header bar... but the errors do NOT show up as red exclamation marks next to the line number of the incorrect lines, nor does the error message appear overlaying the editor code on the right. There just is simply no inline, in-editor markup for errors; even though published books such as "Swift Programming" by Mathias and Gallagher very clearly show such error markup in their book. Further, this is just within a playground so far, so I don't believe the comments about Product | Clean Build Folder and the like are relevant (at least this option remains greyed out). I am using Xcode version 8.3.2 (8E2002) and Xcode | Preferences... | General | Show live issues is checked. I've searched for other possibly related optional settings that might control this behavior, but I have not yet found one obviously related and affecting it.

A R C I'm having the same problem. Tried to reinstall XCode twice already and there's no improvement. I also posted this question in other place of the developer forum but haven't heard about any solution for this.

A R C, I am having the exact same problem. Using Xcode Version 8.3.2 (8E2002). Really annoying. Were you able to find a solution?

I filled a bug report, maybe that'll help Apple to check this issue. Looks like this forum is basically dead. I would recommend everyone to do this as well.

You got any solution ?

Hi, did you ever figure out an answer for this? I am having the same issues and it makes troubleshooting the code very inefficient. Haven't tried uninstalling and reinstalling yet but going to do that next.

I know this is old. But this is for anyone who searches and finds this when encountering the same problem.

For me, I am using Xcode 14.2 and inline errors stopped appearing when working in a playground. I would get errors when I attempted to run test code, but nothing inline.

So I suggest you check the folllowing:

  1. Menu>Xcode>settings
  2. General tab.
  3. Issues should be set to "Show inline". Ok, this was set correctly in my case and it was still an issue. So continue to 4.
  4. Accounts tab. Here I had an error indicating I had logged out of my AppleID account.
  5. Log back into your appleid account.
  6. Bazinga, inline errors started reappearing.

Good luck. Stay safe. Be kind.

There are some interesting solutions proposed here: https://stackoverflow.com/questions/43819455/xcode-not-displaying-compile-errors I managed to fix it by using DevCleaner from the app store to delete everything.

I want to add to comments from garthoid about AppleID problems.

I ran into problems with errors/warnings disappearing after updating to Xcode 14.3.1 (sorry don't remember previous version I was using).

In my case, I had a company ID (personal LLC company - sole developer) that Xcode said had exprired and needed to log in. I don't really remember when/how this ID was created, but there really is no associated login with Apple for it that I am aware of. I deleted the ID. The company is still listed under "Team" on the Accounts tab.

However, after deleting that ID, Live Issues started working again.

Hope this can be helpful to someone else.

xcode doesn't show compiler errors in code
 
 
Q