43

I have an iOS app that worked well on all devices in iOS 6.

I recently upgraded my xcode to version 5.0 and tried to build the same app for iOS 7 on an iPhone 5.

On building the app, the xCode upgraded something in the code settings, but failed to build with errors.

On the iPad XIB, I get an error : "Illegal Configuration : Auto Layout on iOS Versions prior to 6.0".

I tried enabling and disabling the "Use Autolayout" checkbox in the File Inspector, but it didn't work.

Please help me fixing this issue.

ToolmakerSteve
  • 18,547
  • 14
  • 94
  • 196
metsburg
  • 2,021
  • 1
  • 20
  • 32

7 Answers7

79

Your problem is that the "Deployment Target" for your project is "5.0" and you are using a feature that isn't available for iOS 5.

Check the "General" tab for your build target

enter image description here

and update it to at least 6.0 to use Auto Layout

enter image description here

David Rönnqvist
  • 56,267
  • 18
  • 167
  • 205
43

In your .xib file in Xcode 5, click on the offending control. Go to the properties menu on the right and click on the "File Inspector" tab. It is the tab that looks like a sheet of paper. On that tab, there is a section called "Interface Builder Document". Make sure "Builds for" property is set for "iOS 6.0 and Later". If none of the other fixes above have worked, this is likely your culprit.

Christine
  • 640
  • 4
  • 9
  • 2
    NOTE --- If anyone is searching for this, I answered after the conversation was completed. This is the answer for this problem if the above does not fix it. I hope I can help you. ---- – Christine Sep 20 '13 at 17:52
  • This fixed it for me. The original value was Project Deployment (which I already set to 6.0) but it still didn't work with that setting. – radj Sep 24 '13 at 08:09
  • I was having this same problem after updating Xcode. This worked perfectly for me. – GhostShaman Oct 11 '13 at 18:12
14

There is very simple fix. You have just to uncheck "Use Auto Layout" in General tab. More information http://shreekantpawar.com/2012/12/20/simple-solution-to-auto-layout-on-ios-versions-prior-to-6-0-error-in-mac-osx-10-7-and-later/

Anton Sivov
  • 404
  • 6
  • 16
7

Assuming you are actually targeting only iOS 6.0+, it sounds like an issue related to upgrading Xcode. Sometimes, things can go awry when transitioning to a newer Xcode version.

Here are some general tips you can try:

  1. Clean the project (press Cmd + Shift + K)
  2. Reset the simulator (iOS Simulator menu item -> "Reset Content and Settings")
  3. Restart Xcode
  4. Try building again, hopefully you can now
JRG-Developer
  • 12,454
  • 8
  • 55
  • 81
  • No, that doesn't work. And I'm actually targeting iOS 5.0+. Does that mean we'll have to change minimum deployment target? – metsburg Sep 11 '13 at 10:26
  • 2
    Without going into much detail of Xcode 5 (I am under NDA...), it seems like it's now more difficult to support iOS 5+. Apple seems to be strongly encouraging developers to support iOS 6+ only. iOS 7 makes some pretty radical changes in places that have made it difficult to even support 6.0+... to this regard, we have dropped support for iOS 5 entirely. – JRG-Developer Sep 11 '13 at 10:29
  • Yes, agreed. I tried a few things but the only valid option seems to be upgrading the minimum deployment target. – metsburg Sep 11 '13 at 11:00
1

Autolayout is a feature of iOS6.0 and later, If you need to support iOS 5, don't use auto layout.

https://developer.apple.com/library/ios/releasenotes/General/WhatsNewIniOS/Articles/iOS6.html#//apple_ref/doc/uid/TP40011812-SW1

Please go through above doc, and check "What's new in iOS6.0" and serach for "Auto layout"

https://discussions.apple.com/message/19879144#19879144

Gaurav Borole
  • 796
  • 2
  • 13
  • 32
0

The problem may be because of target version in of your project,it may be 5.0 i guess.There is a solution for this problem

step1.Select your project

step2.select the General tab

step3.change the project deployment target.

Rahul K Rajan
  • 776
  • 10
  • 19
0

I encountered the same problem and checked if any of the deployment target settings are set below IOS 6.0.

All the above mentioned settings were in order showing IOS 7.0 for all of them. So I looked deeper under the settings tab where I found that I have a sub-entry under release that says "Any Architecture" set to 5.5.1. I changed this to IOS 7.0 and that did the job for me.

Just writing it down here in case I need to look for it again in the future.

Rio Bautista
  • 433
  • 5
  • 4