xcode Resolve "Safe Area Layout" errors

8.9k views Asked by At

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.

6

There are 6 answers

1
Joey On BEST ANSWER

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.

1
Anton Tropashko On

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.

0
Fred T On

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.

0
Aximem On

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
2
 Dmitriy Greh On

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

0
S Yoshida On

Try closing and then reopening Xcode.