Xcode Storyboard warning: Constraint referencing items turned off in current configuration. Turn off this constraint in the current configuration

Zhihao Yang picture Zhihao Yang ยท Oct 24, 2014 ยท Viewed 28.5k times ยท Source

This warning happens in Xcode 6.1. Anyone have ideas what does this warning mean and what will happen with it? Many thanks!

Below is a screenshot with the warnings opened in source code"

enter image description here

How to find which constraint causes the warning? Xcode does not tell you which constraint is the problem.

enter image description here

Answer

BastiBen picture BastiBen ยท Dec 16, 2014

This warning can be annoying and happens as of Xcode 6.1.1. The main problem is that you can not easily find the referenced constraint by clicking on the warning. I guess this is a bug and will get fixed sooner or later.

However, in the meantime you can use this little workaround:

Step 1: Detect annoying warning ๐Ÿ˜ฑ

Annoying warning

Step 2: Right/Ctrl-Click on warning, select Reveal in Log ๐Ÿ˜จ

enter image description here

Step 3: Admire the beauty of the following log snippet:

... snip ...
/Devel/MyCrippledAppNG/MyCrippledApp/Main_iPad.storyboard:Dlb-cb-nWC: warning: Constraint referencing items turned off in current configuration. Turn off this constraint in the current configuration.
/Devel/MyCrippledAppNG/MyCrippledApp/Main_iPad.storyboard:6Ze-mO-v5N: warning: Constraint referencing items turned off in current configuration. Turn off this constraint in the current configuration.
/Devel/MyCrippledAppNG/MyCrippledApp/Main_iPad.storyboard:9av-xw-u1o: warning: Constraint referencing items turned off in current configuration. Turn off this constraint in the current configuration.
/Devel/MyCrippledAppNG/MyCrippledApp/Main_iPad.storyboard:RPt-Uf-vaZ: warning: Constraint referencing items turned off in current configuration. Turn off this constraint in the current configuration.
/Devel/MyCrippledAppNG/MyCrippledApp/Main_iPad.storyboard:Rnc-4M-7jV: warning: Constraint referencing items turned off in current configuration. Turn off this constraint in the current configuration.
/Devel/MyCrippledAppNG/MyCrippledApp/Main_iPad.storyboard:epJ-D9-KEF: warning: Constraint referencing items turned off in current configuration. Turn off this constraint in the current configuration.
/Devel/MyCrippledAppNG/MyCrippledApp/Main_iPad.storyboard:4HC-Gu-01w: warning: Constraint referencing items turned off in current configuration. Turn off this constraint in the current configuration.
... snip ...

Hmmm... What's this...?

interesting

Step 4: Let's toss that into the project search bar... ๐Ÿ˜

search

๐Ÿ˜ฎ Yep, you guessed right. Click it.

Step 5: ๐Ÿ˜ OMG! Enjoy a few extra minutes of productivity until Apple fixes this annoying bug. ๐Ÿ˜Ž

wheeee


For 2016...

  • If you can't get it with 'Reveal in Log', show the Report Navigator. (That is the rightmost tab on the leftmost column.) Delve into the build results there. That will show the build log, including the constraint ID. courtesy buildsucceeded

enter image description here

enter image description here

  • Note that for Xcode of 5/2016, annoyingly you have to quit and restart Xcode to clear this warning in some cases.

  • Note that confusingly, the same error can be caused by an unrelated problem (this appears to be an Apple bug or poor use of error language): if you have IBInspectable items, and happen to rename them in your Swift files. Xcode does not delete the old-name UserDefinedRuntimeAttributes for you. Simply click to "Identity Inspector" (item 3 on right panel) and delete the dud items.

For 2017...

  • Yet another common, and indeed simpler, cause of the problem. If you happened to un-Install an item: As of writing, very simply Xcode does not know to automatically also uninstall any constraints which lead to that item. Quite simply, look at any un-Installed items, and for all of its constraints, just mark them un-Installed. (Or simply, perhaps just temporarily delete the un-Installed item altogether, to see if that's the problem.)