UIStackView before iOS 9.0
Solution 1
Check inProject Targets-> Deployment info -> Deployment Target
.If it's not 9.0 change it to 9.0.
You need to change the deployment target of your application's target to iOS 9. Otherwise the app supports down to whatever OS that your deployment target is set to.
Not solved?? Check out for other reason??? Check this:
If your Deployment target is already set to 9.0 and you still get this error then try then check your project File inspector-> Project Document -> Project Format
and check if its Xcode-6.3-compatible
or not.If its not then set it to Xcode-6.3-compatible
.
The other reason is may be you accidentally add UIStackView
and thats why you encounter the problem. UIStackView
supports 9.0 and later and your deployment target doesn't allow that. So just check if you accidentally add UIStackView
and if you added and you don't want it than just remove it.
Note: setting the deployment target to 9.0 means that only devices running iOS9 will be able to run your app
Solution 2
The accepted answer requires you to change your entire project deployment settings. If you don't want to require iOS 9 for your entire app, you can do this on an individual basis for a single xib or storyboard by setting the Builds for property in the file inspector pane of Xcode:
Set this to iOS 9.0 or later and you will be able to continue to build your app for a lesser deployment target (7.0 in my case). Of course your app will crash if you attempt to load the xib on a device < iOS 9, so be sure to check this in code and take appropriate actions.
Solution 3
The previous answers don't actually address the idea of removing the offending UIStackView, rather they change the deployment target to correct the issue. My solution doesn't force you to change deployment targets.
I ran into this issue when I accidentally added a UIStackView (which is easy to do when adding layout constraints). To fix this issue, I went to the Document Outlet pane (shown below) and pulled my 'Round Style Text Field' out of the 'Stack View' hierarchy and into the 'View' hiearchy. Then you can delete the Stack View.
This corrected the error for me, and I didn't have to change deployment targets. Hopefully this helps.
Solution 4
In my case, my deployment target was already set to 9.0. I resolved this error by updating the project format from Xcode-3.2-compatible
to Xcode-6.3-compatible
.
This can be found on the main Settings page of your Xcode project in the right column.
Comments
-
bably almost 2 years
I recently upgraded XCode to the latest Version 7.0 beta 3 (7A152u).
I am using Swift for building an iPhone app and when I try to use a Stack View in Main.storyboard I get the error "UIStackView before iOS 9.0".
I thought with the upgrade to Xcode 7 beta 3, I have iOS 9. Please correct my understanding as I am quite new to Swift development.
-
bably almost 9 yearsThanks for your quick reply. It fixed my problem :)
-
Philipp Otto almost 9 yearsConsider that setting the deployment target to 9.0 means that only devices running iOS9 will be able to run your app
-
Felker over 8 yearsOP mentioned they were a beginner, so I figured it was added by accident. Noticed you edited your post with that possibility as well. In my opinion, the importance of deploying to multiple iOS version outweighs the Stack View shortcut for adding layout constraints.
-
devios1 over 8 yearsSee my answer to avoid the error without changing deployment target.
-
Oriol over 7 yearsI did it and the error was still there. I spent a lot of time looking for an answer until I closed Xcode and opened it again and the error dismissed.