Can't use safe areas in Xcode 9 after upgrading minimum deployment target to iOS 9 - xcode9

I have just changed my app from supporting iOS 8 and up to supporting iOS 9 and up. I believe I've done this properly, since when I now build my app, I'm getting warnings for everything in the app which was deprecated in iOS 9.
I am using Xcode 9, GM seed.
The problem is that I cannot enable the "Use Safe Area Layout Guides" toggle in any of my storyboards. When I do, I get a warning "Safe Area Layout Guide before iOS 9.0". Is there some additional setting that I need to update? A clean and build did not fix the problem.

Just deselect "Use Safe Area Layout Guides" option, which should fix this.
A screenshot below may point you the right direction.
Hope this image can help

When you changed the deployment target, did it automatically change the deployment target in your storyboard? (File inspector when opening the Storyboard)
Did you update the deployment target in both the Project and in (all) your target(s)?
Project:
Target:

I didn't try quitting Xcode and restarting it before posting to SO! Sorry! The answer is, quit Xcode and try again.

Simple fix.
In file inspector for the view, look for Builds For in Interface Builder Document and in there select iOS 9 and later.

Related

Xcode 9 - Safe Area Layout Guides Error Comes Back

I am making a game in SpriteKit for iOS, and I want my app to support iOS 8.0 devices. I changed my deployment target to 8.0, and suddenly I have an error:
Main.storyboard:7Ti-J4-z1q: error: Safe Area Layout Guide before iOS 9.0
So I Google how to disable them, and I uncheck the "Safe Area Layout Guide" box in all of my storyboards:
I build again, only to the same error, even though it is unchecked. I tried restarting Xcode, deleting and recreating the storyboards, but nothing seems to work!
Does anyone know how to fix this issue? Thanks!
UPDATE:
After restarting Xcode, the check box reappears checked, even after unchecking and saving.
Ok, after searching through settings, I realized that you also have to uncheck safe area layout guides under your view controller, so now I have unchecked it there and it builds successfully!

Items in Root.plist are not display in settings. iOS9/Xcode7-beta5

None of my settings options are appearing for my project in iOS9. This happens not only with my project that has been converted to swift 2.0 but also the app from TestFlight which is Swift 1.2 compiled from Xcode 6. Is this an iOS 9 issue?
My problem is similar to this one. However, my setting never appear, even on the first launch.
Any ideas? Has anyone else come across this problem? Any input is welcome.
I found a solution to my problem here in the apple dev forums.
"My settings were blank, too, even though they were fine in the simulator. I ended up having to reset ALL settings and performing a full restore. This was a PITA, since it required re-entering passwords and my thumbprints. I sure don't want my users to have to go through this after the ios9 GM release"

Destination toolbar disappeared on XCode 6.4

Today in the morning I tried to compile my project to run in my device and I found the destination toolbar disappeared and I cannot choose my IOS device or IOS Simulator device as target. (I can do it in the Product/Destination Menu)
After some research I found the >> at the right on the screen and when I pushed a Scheme option appeared but it is disabled and I can't enable again.
This is what I tried with no success:
Open an old project to see if the problem was in my project
Create a new project (with Swift and Objective C but I don't think this make any difference)
Restart my computer
Hide and show the toolbar (View menu/Hide Toolbar and the View menu/Show Toolbar)
I tried all the previous options with the device connected and disconnected
I have installed the IOS Simulator 8.4 (when I run my project it runs in the last selected simulator) and XCode 6.4.
Looks like Xcode hides that menu when the window is a certain size. I have to make my window quite large before it comes back.
Not a fix as such but you can work around it using the menus: Product > Scheme and Product > Destination
You're probably running into the same issue I am. Like #BrandonWilliams said in his answer, it appears again if the Xcode window is wide enough. The underlying cause, for me at least, seems to be that in this build of Xcode (6.4) running on El Capitan beta 2 (with Xcode 7 beta installed), I am seeing duplicate simulators for iOS 8.4. And since there are two of the same version, the Schemes dropdown shows some sort of long GUID next to each one, causing the Scheme dropdown to be quite large:
I came to SO looking for an answer but realized that I had seen this issue before.
So the problem is basically that auto layout sucks (I mean it is not working properly in Xcode 6) and on El Capitan, the destination toolbar is for some reason hiding instead of collapsing properly. So when your Xcode window is narrow, the destination toolbar disappears.
But, if you expand the window far enough, it shows back up again.
In case you can't tell, in the first screenshot, the window is about 1241 pixels wide and in the second screenshot the window is 1541 pixels wide.
Go to Product then Destination and choose at which simulator or device you want to test your build.
I'm running with same problem. You can select device or change scheme using below steps:
Select Product from menu
Select Scheme or Destination
Select required Scheme option or Destination option
Alternative Solution:
The only solution is to use Xcode 7 or above. I've installed Xcode 7.1 and found Scheme/Simulator list available. Refer screenshot.
It seems that Xcode 6 or below doesn't support OS X El Capitan.
I am still seeing this problem in Xcode 7.2 on iMac with resolution 1920x1080. Resizing the XCode windows dens't help. I can have the menu bar back if I push the green button and go to full screen mode. But that's pretty annoying. This is how I finally figure out a solution that works for me. I notice that only if I open the project file that I have been working daily that the menu bar is missing. If I create a new project, the menu bar is there. And here is my solution:
Remove your project file on disc (or move it to a different folder)
Open the Welcome to Xcode window by shift+command+1
Make sure your project is no longer under this list. If it is still there, click on it and Xcode will tell you the project is not found and it will be removed.
Add the project file back and open it and I have my menu bar back (if you have moved it, simply opening it from a different file location may work I guess)
I guess the problem is that some cache value in Xcode about the project file is messed up somehow. Hope this helps.
I make my XCode screen little big and now find both options.
On XCode 9.0 beta, this worked for me: select View -> Show Toolbar from menu
right click on title bar -> select show toolbar
Fixed it by deleting the following file ~/Library/Preferences/com.apple.dt.Xcode.plist and restarting Xcode.
The downside is that Xcode preferences dropped to defaults obviously.

Xcode 5 - "iOS Simulator failed to install application" every time I switch simulators

Using Xcode 5 GM, anytime I switch to the 5.1, 6.0 or 6.1 simulators to test, I get the error "iOS Simulator failed to install application." When I reset the simulator it works, but this is getting very tiring.
Anybody have a permanent fix or workaround?
Looks like this is a known issue. From the Xcode 5 release notes:
After switching the minimum deployment target of an application from
iOS 7.0 to a release prior to iOS 7.0, building and running the
application may fail with the message “iOS Simulator failed to install
the application.”
Go to the iOS home screen, click and hold the application icon, then tap the hovering “X” button to delete the application. 13917023
Another release note:
iOS Simulator
If an iOS app is detached, relaunching the same app from Xcode will
result in a black screen in the Simulator even though the new app is
launched. Terminate the app in the Simulator or relaunch it for the
second time. 14648784
Delete the old version app in your simulator (usually iOS 6.x).
Alternatively, header over to iOS Simulator - Reset Content and Settings.
This can be easier when you have a lot of apps on the simulator and can't remember which one you're currently working on.
You need to do this for every iOS Simulator version that causes the problem.
None of the other suggestions worked for me. However, after comparing my existing app settings to a new vanilla project, I noticed that the "Build" field for my Target was blank. Once I put something in that field, the app installed just fine!
if you have already developed project and you used xib to develop views then
X-Code > Inspector Selector Bar > Interface Builder Document > opens in > and change from Xcode Default(5.o) to Xcode 4.6 .
Build and Run your app it will run successfully, if it won't run again then, header over to iOS Simulator - Reset Content and Settings. delete old app from simulator then Run again.
i got the same problem but solved by following way....
Launch the iOS Simulator
Go and click "iOS Simulator" menu
Click "Reset content and settings"
Close simulator and rebuild your app.
Above screen shot is showing the way how you can do this...
I think this works for you...!!!
Deleting the app in the simulator works for me.
just wanted to add that this happen only if I open xib that created in xcode 4.6
If it's other files, this not happen
try this ....
in my case nothing have worked for me , after resetting the content simulator also , i am not able to install the app on simulator . after that i just changed my project location . i just moved the project to other location . then it installed successfully.
None of the above things worked for me. I just reinstalled xcode and it worked.
Ran into this issue today. Found it was an empty Reference Folder (blue folder) causing this. Removed the folder from Resources in Build Phase... cleaned build folder for the heck of it, and it went away.
/Users/YOURUSERNAME/Library/Developer/Xcode/ --> remove all contents of this folder, then simply launch the app from Xcode.
To check your Executable file settng ex.$(EXECUTABLE_NAME)
(Project setting - info property page)
I have different issue when getting error message “iOS Simulator failed to install application”, the reason is because I have added a property in App-Info.plist without any value. For instance, [Application Category] with no value. Thus the error will show up as well.
When I got this error, the image of the phone actually appeared, but the image of the app I wanted to test did not. Instead, I was on the main page of the phone that shows the apps you have. I fixed this problem by deleting the many icons that appeared on the start screens - about 30 of them. These had been created when I testing apps over the months. So, not saying its a solution, but it started working after I deleted the old app images.
For me it was -framework XCTest.
It made the app die with iOS Simulator failed to install application
and on the device Could not inspect the application package.
Removed it and now works.
You are using Xcode GM which is under beta stage. Use latest Xcode 5.1.1 available.
Also, these error occur while switching between simulator (32 bit and 64 bit).
Quit the simulator and re-build the application. OR
Reset simulator from "iOS simulator" -> "Reset content and settings.."
I changed my app name and bundle id midway. I happened to delete the Executable File name in my plist. I changed it back to "${EXECUTABLE_NAME}" (no quotes) and I'm back in business.

How did my Xcode project get changed from iOS project to an OSX project?

I've been doing only iOS development and never made an OSX app. In the iOS project I'm working on now I see that suddenly Xcode thinks it's an OSX project. The all my framework files are shown in red (missing), and lots of the options in the project panel show choices that are only appropriate for OSX such as "deployment target", which offers only 10.4, 10.5, 10.6 etc. and in Build Settings the Valid Architecture shows i386 x86_64 with no drop-down options.
What happened? How can I change this back to an iOS project?
could be 2 late to answer this question, however, this answer might help someone in the future, as the above answer wasn't helpful for me, so here is what I have done.
1- on the left top corner of Xcode click on the scheme.
2- click edit scheme
3- in the new window change "Executable" from non to the name of your project scheme "target"
4- on the top where it says "My Mac 64-bit" if it didn't changed automatically to iPhone/iPad change it manually.
5- if there wasn't any option, in bottom of the window click "Manage Schemes" and make sure the
check box next to your project scheme is checked.
hope this could help and save anyone time.
By your comment you should not have an issue navigating this.
Go to your Project (in upper left) -> Project (project name in submenu) -> Build Settings -> under Architectures menu select Base SDK and choose iOS 6.1.
This should switch your project back. Now under Info you should see your Deployment Target options have switched from saying OS X Development Target to iOS Development Target
As for why it originally changed, I have no idea. But hopefully this will fix your issue.
I know this is an old post, but this just happened to me in a project with multiple targets.
I'm using github and it had marked one of my target scheme files with a merge block at the top of the file after using a newer compiler. I could find a way to edit the scheme through XCode, but upon re-opening the project, it would be bad again.
I had to edit the file manually and complete the merge edit.
This recently happened to me with Xcode 8 where an old iOS project was turned into a dual destination macOS / iOS one.
To fix the issue I changed the Base SDK under Project -> Build Settings to Latest iOS (iOS10) and the change rippled through removing the macOS destination.
I fixed this by deleting the scheme showing issue and recreate it. This time it gets created as desired scheme type showing all the simulators and devices attached, if any.

Resources