UIViewAlertForUnsatisfiableConstraints in Xcode’s Breakpoint Navigator. When it pauses, run expr -l objc++ -O -- [[UIWindow keyWindow] _autolayoutTrace] in the LLDB console to print a detailed view hierarchy showing exactly which views have ambiguous or missing constraints.Why this happens
Auto Layout cannot satisfy all active constraints simultaneously. When the engine detects a conflict, it logs the warning you see in the console and automatically breaks one constraint to keep the app running. The message tells you which constraint was broken, but not why the system got into that state or which view in your hierarchy is the root cause.
The method UIViewAlertForUnsatisfiableConstraints is an internal UIKit hook that fires every time this recovery happens. It is not part of your code, so a normal breakpoint in your source files will never hit it. You need a symbolic breakpoint that stops on the symbol name itself.
How to fix it
1. Add a symbolic breakpoint for the constraint alert
- Open the Breakpoint Navigator (
⌘8). - Click the Add (+) button in the lower-left corner.
- Choose Add Symbolic Breakpoint….
- In the Symbol field, enter exactly:
UIViewAlertForUnsatisfiableConstraints - Leave Module blank (or type
UIKitCoreon recent SDKs) and click Done.
The breakpoint appears in the list. Enable/disable it like any other breakpoint.
2. Attach an LLDB action to print the layout tree
When the breakpoint hits, you want immediate visibility into the view hierarchy. Add an Action to the breakpoint so the trace prints automatically:
- Right-click the new symbolic breakpoint → Edit Breakpoint….
- Click Add Action → choose Debugger Command.
- Paste the following command (Swift projects):
expr -l objc++ -O -- [[UIWindow keyWindow] _autolayoutTrace]
For Objective-C projects you can use the shorter form:
po [[UIWindow keyWindow] _autolayoutTrace] - Check Automatically continue after evaluating actions so the app keeps running after the log prints.
- Close the popover.
Now run the app. Every time Auto Layout breaks a constraint, the console will show a tree like:
UIWindow:0x7f88a8e4a4a0
| UILayoutContainerView:0x7f88a8f23b70
| | UINavigationTransitionView:0x7f88a8ca1970
| | | UIViewControllerWrapperView:0x7f88a8f2aab0
| | | | •UIView:0x7f88a8ca2880
| | | | | *UIView:0x7f88a8ca2a10
| | | | | | *UIButton:0x7f88a8c98820'Archived'
| | | | | | | UIButtonLabel:0x7f88a8cb0e30'Archived'
| | | | | | *UIButton:0x7f88a8ca22d0'Download'
| | | | | | | UIButtonLabel:0x7f88a8cb04e0'Download'
| | | | | | *UIButton:0x7f88a8ca1580'Deleted'
| | | | | | | UIButtonLabel:0x7f88a8caf100'Deleted'
| | | | | | •UIView:0x7f88a8f39fa0, MISSING HOST CONSTRAINTS
| | | | | | | *UIButton:0x7f88a8cb9bf0'Retrieve data' - AMBIGUOUS LAYOUT …
Key markers in the output:
– • — the view that has constraints but they are insufficient (missing host constraints).
– * — a view with ambiguous layout (multiple valid solutions).
– AMBIGUOUS LAYOUT / MISSING HOST CONSTRAINTS — exact constraint IDs that are under-determined.
3. Locate the offending view in code
Copy the address (e.g., 0x7f88a8cb9bf0) of the view flagged as ambiguous. In the LLDB console type:
po 0x7f88a8cb9bf0
LLDB prints the object description, often including your custom class name or accessibility identifier. If you set accessibilityIdentifier on your views in code or Interface Builder, it appears here, making the match instant.
4. Alternative: Constraint debugging without breakpoints
If you prefer not to pause execution, enable the Auto Layout debug logging launch argument:
- Edit the scheme (
⌘<). - Run → Arguments → Arguments Passed On Launch → add
-UIViewLayoutConstraintDebuggingLevel 2. - Run the app. The console emits every constraint change with full backtraces.
This is noisier but useful for CI runs where you cannot attach the debugger interactively.
How to prevent it
- Assign meaningful
accessibilityIdentifierstrings to every view you constrain in code or IB; they surface in_autolayoutTrace. - Use Interface Builder’s “Update Frames” and “Resolve Auto Layout Issues” menus after adding constraints to catch conflicts at design time.
- Prefer stack views and layout guides over manual edge constraints; they reduce the chance of over-constrained layouts.
- Run the View Debugger (
Debug → View Debugging → Capture View Hierarchy) periodically; it highlights ambiguous frames in purple. - Unit-test constraint activation paths with
UIViewController.loadViewIfNeeded()andview.setNeedsLayout()in a test target.
FAQ
Why does the symbolic breakpoint never hit?
Ensure the symbol spelling is exact (UIViewAlertForUnsatisfiableConstraints) and the breakpoint is enabled (blue, not gray). On Apple Silicon Macs running iOS simulators, the symbol lives in UIKitCore; leaving Module blank works, but you can explicitly set Module to UIKitCore if needed.
The _autolayoutTrace output is truncated in the console.
Increase the console buffer: Xcode → Settings → Behaviors → Running → Show → All Output. Or redirect the expression to a file:
expr -l objc++ -O -- (void)[[UIWindow keyWindow] _autolayoutTraceWithFileHandle:[NSFileHandle fileHandleForWritingAtPath:@"/tmp/layout.txt"]]
Can I use this technique on visionOS or macOS Catalyst apps?
Yes. The same UIKit symbol exists on visionOS and Catalyst. The _autolayoutTrace method is available on UIWindow (or NSWindow via window._autolayoutTrace on AppKit). The breakpoint setup is identical.
Parts of this guide are adapted from content licensed under CC BY-SA 3.0; this article is shared under the same license.