QuickLookPreviewController generates lots of constraint warnings

I have been using the QLPreviewController in an app for some time now and have always gotten a flurry of constraint warnings when it launches which I have ignored. I have looked at them and don't believe they are due to my code and the app seems to work.

Tried to attach a simple app that loads a ViewController with a single button that when pressed creates an object that generates and displays a CSV file via QLPreviewController but can't.

First warning:

Invalid content type identifier com.apple.pktransaction specified in extension com.apple.Passbook.QuicklookPreviewExtension

Second warning:

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:0x60000213ae40 h=-&- v=--& UINavigationBar:0x10621ddf0.minY == 0   (active, names: '|':UILayoutContainerView:0x106208830 )>",
    "<NSAutoresizingMaskLayoutConstraint:0x60000213ae90 h=-&- v=--& UINavigationBar:0x10621ddf0.height == 44   (active)>",
    "<NSLayoutConstraint:0x600002137890 V:[UINavigationBar:0x10621ddf0]-(0)-[UIFocusContainerGuide:0x600003d04000'UINavigationControllerContentFocusContainerGuide']   (active)>",
    "<NSLayoutConstraint:0x600002137020 UIFocusContainerGuide:0x600003d04000'UINavigationControllerContentFocusContainerGuide'.bottom == UILayoutContainerView:0x106208830.bottom   (active)>",
    "<NSLayoutConstraint:0x6000021366c0 V:|-(0)-[UILayoutContainerView:0x106208830]   (active, names: QLPreviewControllerView:0x10631de80, '|':QLPreviewControllerView:0x10631de80 )>",
    "<NSLayoutConstraint:0x600002134d20 V:[UILayoutContainerView:0x106208830]-(0)-|   (active, names: QLPreviewControllerView:0x10631de80, '|':QLPreviewControllerView:0x10631de80 )>",
    "<NSLayoutConstraint:0x60000211dcc0 'UIView-Encapsulated-Layout-Height' QLPreviewControllerView.height == 0   (active, names: QLPreviewControllerView:0x10631de80 )>"
)

Will attempt to recover by breaking constraint 
<NSLayoutConstraint:0x600002137890 V:[UINavigationBar:0x10621ddf0]-(0)-[UIFocusContainerGuide:0x600003d04000'UINavigationControllerContentFocusContainerGuide']   (active)>

Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKitCore/UIView.h> may also be helpful.
dealloc Query controller [A899BAB1-6730-4B7D-9CBE-488EC6641B6B]
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:0x6000021229e0 h=--& v=--& _UIToolbarContentView:0x10641e920.width == 0   (active)>",
    "<NSLayoutConstraint:0x60000213a6c0 H:|-(0)-[_UIButtonBarStackView:0x106507620]   (active, names: '|':_UIToolbarContentView:0x10641e920 )>",
    "<NSLayoutConstraint:0x60000213a710 H:[_UIButtonBarStackView:0x106507620]-(0)-|   (active, names: '|':_UIToolbarContentView:0x10641e920 )>",
    "<NSLayoutConstraint:0x600002146bc0 'IB_Leading_Leading' H:|-(16)-[_UIModernBarButton:0x106519cd0]   (active, names: '|':_UIButtonBarButton:0x106519ab0 )>",
    "<NSLayoutConstraint:0x600002146c60 'IB_Trailing_Trailing' H:[_UIModernBarButton:0x106519cd0]-(16)-|   (active, names: '|':_UIButtonBarButton:0x106519ab0 )>",
    "<NSLayoutConstraint:0x600002147f70 'UISV-canvas-connection' UILayoutGuide:0x600003b050a0'UIViewLayoutMarginsGuide'.leading == _UIButtonBarButton:0x106519ab0.leading   (active)>",
    "<NSLayoutConstraint:0x60000213b020 'UISV-canvas-connection' UILayoutGuide:0x600003b050a0'UIViewLayoutMarginsGuide'.trailing == UIView:0x10651c300.trailing   (active)>",
    "<NSLayoutConstraint:0x60000213bde0 'UISV-spacing' H:[_UIButtonBarButton:0x106519ab0]-(0)-[UIView:0x10651c300]   (active)>",
    "<NSLayoutConstraint:0x60000213a5d0 'UIView-leftMargin-guide-constraint' H:|-(0)-[UILayoutGuide:0x600003b050a0'UIViewLayoutMarginsGuide'](LTR)   (active, names: '|':_UIButtonBarStackView:0x106507620 )>",
    "<NSLayoutConstraint:0x60000213a670 'UIView-rightMargin-guide-constraint' H:[UILayoutGuide:0x600003b050a0'UIViewLayoutMarginsGuide']-(0)-|(LTR)   (active, names: '|':_UIButtonBarStackView:0x106507620 )>"
)

Will attempt to recover by breaking constraint 
<NSLayoutConstraint:0x600002146c60 'IB_Trailing_Trailing' H:[_UIModernBarButton:0x106519cd0]-(16)-|   (active, names: '|':_UIButtonBarButton:0x106519ab0 )>

Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKitCore/UIView.h> may also be helpful.
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. 
(
    "<NSLayoutConstraint:0x6000021374d0 UILayoutGuide:0x600003b21340'TitleView(layout=0x106416a30)'.leading >= UILayoutGuide:0x600003b216c0'UIViewLayoutMarginsGuide'.leading   (active)>",
    "<NSLayoutConstraint:0x6000021372f0 UILayoutGuide:0x600003b21340'TitleView(layout=0x106416a30)'.trailing <= UILayoutGuide:0x600003b216c0'UIViewLayoutMarginsGuide'.trailing   (active)>",
    "<NSLayoutConstraint:0x60000216ce60 'UIView-Encapsulated-Layout-Width' _UINavigationBarContentView:0x106416700.width == 0   (active)>",
    "<NSLayoutConstraint:0x600002134f50 'UIView-leftMargin-guide-constraint' H:|-(16)-[UILayoutGuide:0x600003b216c0'UIViewLayoutMarginsGuide'](LTR)   (active, names: '|':_UINavigationBarContentView:0x106416700 )>",
    "<NSLayoutConstraint:0x600002134b90 'UIView-rightMargin-guide-constraint' H:[UILayoutGuide:0x600003b216c0'UIViewLayoutMarginsGuide']-(16)-|(LTR)   (active, names: '|':_UINavigationBarContentView:0x106416700 )>"
)

Will attempt to recover by breaking constraint 
<NSLayoutConstraint:0x6000021372f0 UILayoutGuide:0x600003b21340'TitleView(layout=0x106416a30)'.trailing <= UILayoutGuide:0x600003b216c0'UIViewLayoutMarginsGuide'.trailing   (active)>

Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.

@lehrian You could share a link to your test project.

If you're not familiar with preparing a test project, take a look at Creating a test project

I have uploaded a simple app that recreates the issue to Dropbox. Here is the link:

https://www.dropbox.com/scl/fi/yb1b3zh3tzubx0oze6lc4/QLPreviewControllerTest2.zip?rlkey=3m9hiaw06550r5xs4xluoc5gz&st=i3x8obq0&dl=0

The app loads a ViewController with a single button that when pressed creates an object that generates and displays a CSV file via QLPreviewController. When the QLPreviewController is loaded the above flurry of warnings ensue.

Hello. Have you had a chance to look at the code I uploaded? And while I have your attention, the QLPreviewController doesn't seem to honor dark mode. I posted a query about this back in 2020 and never got a response.

https://developer.apple.com/forums/thread/129886

Hello DTS Engineer...are you still there? Have you looked at the simple project I created that recreates this issue?

I'm also having same issues with QuickLookPreviewController.

I too have been ignoring these warnings. However I now have a particular Testflight user having problems with playing Videos in the QuickLookPreviewController so I believe this is because of the constraints

It is a very useful ViewController if it could work properly:-)

Here is my Debug...

2024-11-20 20:42:38.128950+0000 My App[82215:2024054] [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:0x6000021ca620 h=-&- v=--& UINavigationBar:0x11afbadc0.minY == 0 (active, names: '|':UILayoutContainerView:0x11afcf730 )>", "<NSAutoresizingMaskLayoutConstraint:0x6000021ca6c0 h=-&- v=--& UINavigationBar:0x11afbadc0.height == 44 (active)>", "<NSLayoutConstraint:0x6000021d23f0 V:[UINavigationBar:0x11afbadc0]-(0)-[UIFocusContainerGuide:0x600003d283c0'UINavigationControllerContentFocusContainerGuide'] (active)>", "<NSLayoutConstraint:0x6000021d24e0 UIFocusContainerGuide:0x600003d283c0'UINavigationControllerContentFocusContainerGuide'.bottom == UILayoutContainerView:0x11afcf730.bottom (active)>", "<NSLayoutConstraint:0x6000021d2bc0 V:|-(0)-[UILayoutContainerView:0x11afcf730] (active, names: QLPreviewControllerView:0x119c86e70, '|':QLPreviewControllerView:0x119c86e70 )>", "<NSLayoutConstraint:0x6000021d2c10 V:[UILayoutContainerView:0x11afcf730]-(0)-| (active, names: QLPreviewControllerView:0x119c86e70, '|':QLPreviewControllerView:0x119c86e70 )>", "<NSLayoutConstraint:0x6000021ca760 'UIView-Encapsulated-Layout-Height' QLPreviewControllerView.height == 0 (active, names: QLPreviewControllerView:0x119c86e70 )>"

QuickLookPreviewController generates lots of constraint warnings
 
 
Q