Layout issue with constrains how to debug this

Hi guys can someone help me with this I’m trying to debug this but I don’t see any extra or bad constrains here, Xcode is keep showing this:

new Match App[4957:366678] [LayoutConstraints] Unable to simultaneously satisfy constraints.

Probably at least one of the constraints in the following list is one you don’t want.

Try this:

(1) look at each constraint and try to figure out which you don’t expect;

(2) find the code that added the unwanted constraint or constraints and fix it.

(Note: If you’re seeing NSAutoresizingMaskLayoutConstraints that you don’t understand, refer to the documentation for the UIView property translatesAutoresizingMaskIntoConstraints)

(

"<NSAutoresizingMaskLayoutConstraint:0x600000b6af80 h=–& v=–& new_Match_App.CardCollectionViewCell:0x7fc22520cc70.width == 158 (active)>",

"<NSLayoutConstraint:0x600000b43a20 ‘UIIBSystemGenerated’ new_Match_App.CardCollectionViewCell:0x7fc22520ca60.leading == new_Match_App.CardCollectionViewCell:0x7fc22520cc70.leading (active)>",

"<NSLayoutConstraint:0x600000b439d0 ‘UIIBSystemGenerated’ H:[new_Match_App.CardCollectionViewCell:0x7fc22520cc70]-(0)-| (active, names: ‘|’:new_Match_App.CardCollectionViewCell:0x7fc22520ca60 )>",

"<NSLayoutConstraint:0x600000b564e0 ‘UIView-Encapsulated-Layout-Width’ new_Match_App.CardCollectionViewCell:0x7fc22520ca60.width == 50 (active)>"

)

Will attempt to recover by breaking constraint

<NSLayoutConstraint:0x600000b43a20 ‘UIIBSystemGenerated’ new_Match_App.CardCollectionViewCell:0x7fc22520ca60.leading == new_Match_App.CardCollectionViewCell:0x7fc22520cc70.leading (active)>

First this article may help you debug!
https://developer.apple.com/library/archive/documentation/UserExperience/Conceptual/AutolayoutPG/DebuggingTricksandTips.html

Also something is wrong with the leading constraint for the card

You can fix this by making the priority of the constraint lower

1 Like

Thanks MikaelaCaron, I will look into it!

That’s a e very good one tho, I didn’t even think about this I looked into Xcodes dev doc but it was still confusing and I also tried to debug this using the visual hierarchy which is still confusing to me, but Xcode was not showing anything in the docs panel on the left side like usually does it ran the app with no problem, I’ve noticed this when I was trying the logging debugging by following Chriss,

I think Xcode adds those constraints after I create the CardCollectionCell sub class
I’m till struggling to find the solution

I also noticed this in the visual hierarchy some thing a missing I’m not sure why this happened