I had the same problem.
In fact IB (xcode) shows error but you'll get no error when running.
This is because IB can't infer our content size since it's sets when the running.
To silence this error, you could place a place holder size in IB for your stackview items.
this is juste for IB purpose, will not conflict with your final layout.