27

Illegal Configuration - Safe Area Layout Guide before iOS 9.0

What is the correct way to stop this error?

For now I'm merely unchecking "Use Safe Area Layout Guides" which allows me to compile the app without error.

Jacksonkr
  • 31,583
  • 39
  • 180
  • 284

6 Answers6

40

To resolve this issue you need to do next steps:

  1. You need to click on your ViewController in your Interface Builder.
  2. Then go to Attributes Inspector. And click there on "File Inspector".
  3. Disable "Use Safe Area Layout Guides".

Use safe area layout guides disabled

agrm
  • 3,735
  • 4
  • 26
  • 36
Dmitriy Greh
  • 684
  • 8
  • 17
  • 1
    Why is it the correct answer? OP had already mentioned doing that in the question, and for what I understand he wants to use Safe Areas. – Jonathan Cabrera Apr 27 '18 at 21:33
  • @Jonathan Cabrera, he just wanted to solve this error. It can be solved by using my answer. Аfter he solved the issue, he wrote: For now I'm merely unchecking "Use Safe Area Layout Guides" which allows me to compile the app without error. –  Dmitriy Greh May 03 '18 at 07:12
8

Apple told us in WWDC 2017 Session 412 that Safe Area Layout Guide is Backwards deployable. But it seems to be not supporting iOS 8.0. I've got the same error on Xcode 9 GM too.

In my case, I stopped using the Safe Area Layout Guide, but use Top Layout Guide and Bottom Layout Guide, even though they are deprecated on iOS 11.

Joey
  • 2,912
  • 2
  • 27
  • 32
6

In my case all deployment targets had to be raised from 8.0 to 9.0 :-[

In case you have to support 8.0 accepted answer works.

Anton Tropashko
  • 5,486
  • 5
  • 41
  • 66
  • This is actually a good solution because no iOS device has highest iOS version as 8.0. They are either 7.0 or 9.0 which can be seen on this link: https://everyi.com/by-capability/maximum-supported-ios-version-for-ipod-iphone-ipad.html – broch Aug 31 '18 at 13:36
0

If you encounter this error with your CocoaPods, you must force your pods deployment target in podfile with minimum iOS 9.0, XCode 9 should manage this case but this is not working at the time of writing

post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '9.0'
    end
  end
end
Aximem
  • 714
  • 8
  • 27
0

Try closing and then reopening Xcode.

S Yoshida
  • 328
  • 3
  • 8
0

I believe it is imperative to support the latest iOS devices such as iPhone X, iPhone XS, and iPhone XR. The accepted answer to this question fails to address this. In Interface Builder, the Safe Area is a layout guide representing the portion of your view that is unobscured by bars and other content. In iOS 11+, Apple is deprecating the top and bottom layout guides and replacing them with this Safe Area Layout guide.

To resolve this Illegal Configuration Build error you should:

  1. Update your project file to support a Deployment Target of iOS 9, not iOS 8.

  2. Click on the 'Clean Build Folder' menu item off the Project menu.

  3. Close xCode 10, and then restart it.

  4. Rebuild your app.

Note that the 'Illegal Configuration' build error no longer appears, and you are now able to run your app in the simulator of your choice.

Fred T
  • 41
  • 1
  • 4