• Skip to main content
  • Skip to primary sidebar

Ravi Shankar

Tweaking Apps

  • About
  • Portfolio
  • Privacy Policy

Archives for October 2019

Unable to simultaneously satisfy constraints.

October 17, 2019 By Ravi Shankar

A common error that we would see when using Auto Layout is

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

Debugging the verbose shown in the console might look difficult but if you closely go through the messages you should be able to identify the issue.

Let us take the following Auto Layout Constraint error messages.

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:0x281862940 UIImageView:0x14ddb28e0.width == UIImageView:0x14ddb28e0.height (active)>”,
“<NSLayoutConstraint:0x28181c190 V:|-(5)-[UIImageView:0x14ddb28e0] (active, names: ‘|’:UITableViewCellContentView:0x14ddb2750 )>”,
“<NSLayoutConstraint:0x28181cc30 UIImageView:0x14ddb28e0.width == 0.22*UITableViewCellContentView:0x14ddb2750.width (active)>”,
“<NSLayoutConstraint:0x28181eb20 V:[UIImageView:0x14ddb28e0]-(5)-| (active, names: ‘|’:UITableViewCellContentView:0x14ddb2750 )>”,
“<NSLayoutConstraint:0x28186e080 ‘UIView-Encapsulated-Layout-Height’ UITableViewCellContentView:0x14ddb2750.height == 93 (active)>”,
“<NSLayoutConstraint:0x28186e030 ‘UIView-Encapsulated-Layout-Width’ UITableViewCellContentView:0x14ddb2750.width == 375 (active)>”
)

Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x281862940 UIImageView:0x14ddb28e0.width == UIImageView:0x14ddb28e0.height (active)>

The constraints associated with this UIImageView are

This error is result of more than one constraints staistying the same condition. The last line in the log message tells one of the constraint causes this issues. “width == height”. Now identify the second constraint which tries to set the width of this imageview.

There are two constraints trying to set the width for the image view, 1. Propotional Width to and 2. Aspect Ratio. After removing the unwanted constraint and you are good to go.

Let us see one more example for the Constraint errors.

(
“<NSLayoutConstraint:0x281818f00 UIButton:0x14ddb7fe0’BOOK’.height == 50 (active)>”,
“<NSLayoutConstraint:0x28186c050 V:|-(20)-[UIButton:0x14ddb7fe0’BOOK’] (active, names: ‘|’:UITableViewCellContentView:0x14ddb7e50 )>”,
“<NSLayoutConstraint:0x28186c0a0 V:[UIButton:0x14ddb7fe0’BOOK’]-(20)-| (active, names: ‘|’:UITableViewCellContentView:0x14ddb7e50 )>”,
“<NSLayoutConstraint:0x28181aad0 ‘UIView-Encapsulated-Layout-Height’ UITableViewCellContentView:0x14ddb7e50.height == 90.5 (active)>”
)

Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x281818f00 UIButton:0x14ddb7fe0’BOOK’.height == 50 (active)>

 

The last line gives a clue, there are two constraints trying to set the height of the BOOK button. And if you look at the constraints for the BOOK button, you can find 1. Top and Bottom constraints are set for button and 2. Height constraint is also set for Button. Removing any one of the constraint would fix the problem.

Filed Under: Auto Layout, Constraints, NSLayoutConstraint

Upload missing dSYMs to see crashes

October 17, 2019 By Ravi Shankar

If you are using Firebase Crasyltics in your app and if bitcode is enabled then you might see this message

“Upload missing dSYMs to see crashes” when trying to view reported crash in Firebase Crashlytics. In order the see the stack trace, you can try uploading the dSYMs files.

Compress .dSYMs files.

  • Launch Xcode Organizer.
  • Select the App on the Right hand side and navigate to the version which caused the crash.
  • Right click on the version and select Show in Finder.

  • Right click the archive file and select “Show Package Contents”.
  • Copy all the dSYMs files to another location.
  • Compress the file and upload the compress file to Firebase to see see the stack trace.

iTunesConnect

Another option is to download dSYMs files from iTunes Connect.

Select your App -> Activity section -> Select the Version -> Download dSYSM

Filed Under: Crash, dSYMs, Firebase

Primary Sidebar

Recent Posts

  • We have blocked all requests from this device – Firebase Phone Authentication
  • iPhone is not available error message in Xcode
  • Clear CocoaPods cache, re-download and reinstall all pods
  • PDFKit – View, Annotate PDF file in Swift
  • Tab Bar Controller with WebView

Archives

  • September 2020
  • April 2020
  • December 2019
  • November 2019
  • October 2019
  • February 2019
  • October 2017
  • June 2017
  • May 2017
  • March 2017
  • September 2016
  • March 2016
  • February 2016
  • January 2016
  • December 2015
  • November 2015
  • October 2015
  • September 2015
  • August 2015
  • July 2015
  • June 2015
  • May 2015
  • April 2015
  • March 2015
  • February 2015
  • January 2015
  • December 2014
  • November 2014
  • October 2014
  • September 2014
  • August 2014
  • July 2014
  • June 2014
  • April 2014
  • March 2014
  • February 2014
  • January 2014
  • December 2013
  • October 2013
  • August 2013
  • July 2013
  • June 2013
  • April 2013
  • March 2013
  • February 2013
  • January 2013
  • November 2012
  • August 2012
  • July 2012
  • June 2012
  • May 2012
  • March 2012
  • February 2012
  • January 2012
  • December 2011
  • October 2011
  • September 2011
  • August 2011
  • July 2011
  • June 2011
  • April 2011
  • March 2011
  • January 2011
  • September 2010
  • August 2010
  • July 2010
  • June 2010
  • July 2009
  • March 2008

Copyright 2020 © rshankar.com