Xcode 8. Constraint referencing items turned off in current configuration

I was having several views that were not Installed, after updating to xcode 8.1, I had 2 warnings.

Following steps worked for me:

1) Clean the project and restart Xcode, warnings decreased to 1.

2) Selecting the warning will show exactly which constraint having an issue. Open Attributes Inspector and select those views where constraint is applied, look for Installed if its unchecked on the view (not on constraint). You can either select Installed on the view, or unselect Installed on constraint itself.

See screenshot below. Installed was unchecked on view, not on the constraint that the warning was pointing to :)

Installed is unchecked on a view, not on constraint itself

Update: Same issue again with another ViewController, a UIView was not Installed for a size class, I unselect Installed on constraint itself and warning is gone too, I guess its not an Xcode bug, its claiming to turn Installed on/off on both UIView and Constrarint


The short answer: Inspect the source code for your storyboard for each of the ids in your warnings by searching 'id="theIdFromWarning". The ids are for the constraints. When you find the constraint id, it will reference the two element ids. Search for the elements by searching 'id="theIdForElement"' Then you'll find the name or some piece of info in that element source code to find out what element you're looking at. Then switch the storyboard back from source code to the interface builder, find the two elements, and see which size class the related constraint is installed but the element isn't. Example: ViewA.right could be horizontally constrained to ViewB.left, installed on all size classes, but ViewA might only be installed on height=Regular size class. Solution: Install ViewA on all size classes, or uninstall the constraint on all size classes and add the constraint to only the height=Regular size class.

Longer answer, step-by-step:

I was not able to easily see what constraints/elements these warnings were referring to. For me, I was able to right click the warning, and select "Reveal in log". This revealed 10 warnings in this style format:

/my/filepath/to/storyboard:1xe-xx-Bx5: warning: Constraint referencing items turned off in current configuration. Turn off this constraint in the current configuration.

If your log doesn't show a detailed description like this, then right-click on any log reference to Constraint referencing items turned off in current configuration. Turn off this constraint in the current configuration. warning and select Expand all transcripts, then search your log file for the constraint descriptions.

So, I opened my storyboard, right clicked the storyboard file in the project navigator and selected 'view as source code' searched for every constraint by the listed id (in the above example, I searched for the id:1xe-xx-Bx5), and found one reference to it:

<constraint firstItem="Mwb-6O-DKs" firstAttribute="top" secondItem="y2M-Sk-Ygh" secondAttribute="bottom" constant="19" id="1ce-xx-Bx5"/>

What this tells me is:

  • That the constraint has an id of 1ce-xx-Bx5
  • The constraint is associated with two elements:
  • One has the id of Mwb-6O-DKs
  • The other has the id of y2M-Sk-Ygh

So I searched the source code for the first element by id, by searching for id="Mwb-6O-DKs" and found this:

<label ...(truncating for readability sake)...text="Build Label"...(truncating for readability sake)...id="Mwb-6O-DKs">

This tells me that the first element is a UILabel with the title 'Build Label'.

Searching for the second element by id, id="y2M-Sk-Ygh", revealed:

<viewController storyboardIdentifier="login"...(truncating for readability sake)...<layoutGuides><viewControllerLayoutGuide type="top" id="y2M-Sk-Ygh"/>

So I take this to mean that the UILabel with the text "Build Label" has a top constraint that is turned off. (since the viewControllerLayoutGuide constraint should never be turned off, it must be the UILabel.

Lo and behold, it was not installed. I selected the Installed checkbox for the UILabel, and the error disappeared.

1 down, 9 more to go! (F*ing Xcode...)