I open a project from XCode 8 on Sierra macOS, which was working on yesterday with no problems.
Now I see:
The document "Main.storyboard" had 2 internal inconsistencies that were found and repaired. This may be due to an SCM operation such as merging. Please save the document to fix the inconsistencies.
I cannot click either of those buttons. They don't respond. I cannot do anything except close the project. What should I do now to fix this?
Does anyone know reasons that this occurs?
I cannot believe I found the answer...well, got to a solution on this terrible thing that seems to be caused by XCode's interaction with the built-in Source Control.
I had to close XCode a number of times to finally get to this. I was hacking the main.storyboard file using a text editor. I tried all kinds of things.
Finally, I thought about the error message more.
What was "SCM" in that original message? I guessed it was Source Control Module because it mentioned merging.
I then noticed that the capital "M" next to my main.storyboard file on the left where the project files are listed. It looks like:
I guessed that was showing me that Source Control was saying it was "M"odified so I right-clicked on the main.storyboard file and told it to discard changes.
It looks like the following:
After that, I was able to open the storyboard again.
The odd thing is that at one point I was even able to run the project while it was in the corrupted state.
Took a lot of finagling to get it done.
The XCode Devs have to fix this. It's terrible.
EDIT 2 Ugh! What a waste of time. Every time I go to view the storyboard again, then the SCM merges something in and finally i do see something that has to do with the error. it looks like:
oh, sure, it's probably something I've done with the InterfaceBuilder and it's my fault and all, but the terrible horrible stupid XCode has let me do it.
Edit 3 Okay, I noticed that it believes the label is all stretched out. But, it's the source control merge thing that is automatically doing this. I wonder if my entire project is going to be toast?
Edit 4
I was able to get further through this problem with a few more details so I wanted to document them to help others.
Part of the Root Cause
The issue was that for some unknown reason a specific label when placed inside a stackview would go bonkers and attempt to be 9,000,0000,000 units in height.
One Way To Fix
Take a quick look at the 2nd image in this post. It shows where I right-click on the main.storyboard file. I actually saw the label go crazy again with the huge height when Interface Builder attempted to render the storyboard and then I was able to
Conflicting Constraints
I also found a number of conflicting constraints which were questionable and I got all of those settled. After that, I did still see the label go crazy if I copied it into the StackView but at least I could alter it via editing it in the text editor. Good luck.
I had this same issue (5 internal inconsistencies), and found a solution similar to @daylight, but thought I could add more color.
First - useful to highlight how debilitating this was - I could not close the dialog, and thus could not change anything in the storyboard to fix it - horrible bug.
The problem:
on Xcode 8, Xcode was silently changing the storyboard massively (can track the changes via git). Some of these changes added ridiculous heights to labels in stackviews (as per @daylight). Presumably xCode was trying + failing to resolve layout conflicts automatically. These changes were causing / associated with the dialog in this question, which causes a crash.
Once xcode adds these changes, the only way to access the file is by opening as source.
The very first time Xcode 8 opens the storyboard + right after it asks for you to choose a viewing device, I was able to access the the storyboard graphically, which gave me an opportunity to inspect it.
I was not able to fix problems by simply discarding / fixing changes, as Xcode would then make them again.
Solution:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With