Xcode 7.0 - Could not open document

Hi,


I recently upgraded to Xcode 7.0 via the Mac App Store. I have been having an error recently which I have been unable to resolve. Basically, when I try to build (or build and run) my Xcode project (which is an iOS 9 app), I get the following error "LaunchScreen.storyboard - Could not open document".


I have tried so many different methods of trying to resolve the problem, but alas, they have all failed. Here are the methods that I tried:


  • Restart Xcode (Didn't work).
  • Clean and rebuild project (Didn't work).
  • Restart Mac (Didn't work).
  • Reinstall Xcode 7 from the Mac App Store (Didn't work).
  • Delete the "User/Library/Developer" folder and reinstall Xcode 7 from the Mac App Store (Didn't work).
  • Delete the contents of the "Derived Data" folder and rebuild the application (Didn't work).
  • Installed Xcode 7 on a different Mac (Still got the same issue, even with a new Xcode project).
  • I tried the solution in this Stack Overflow question: http://stackoverflow.com/a/31614717/1598906 - But alas it did not work.
  • Finally, I tried the following Terminal command with no avail:
    $ sudo killall -9 ibtoold (Didn't work)
  • Obviously I have always cleaned by project and build folder before building my application (Didn't work).


Below is the error log I am getting from Xcode 7.0:


CompileStoryboard BloodyTest/Base.lproj/LaunchScreen.storyboard
    cd "/Users/daniel_sadjadian_2/Desktop/Test/BloodyTest"
    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    export XCODE_DEVELOPER_USR_PATH=/Applications/Xcode.app/Contents/Developer/usr/bin/..
    /Applications/Xcode.app/Contents/Developer/usr/bin/ibtool --errors --warnings --notices --module BloodyTest --output-partial-info-plist /Users/daniel_sadjadian_2/Library/Developer/Xcode/DerivedData/BloodyTest-dqhxemnfmeljzncdtjhgruuqqnby/Build/Intermediates/BloodyTest.build/Debug-iphoneos/BloodyTest.build/LaunchScreen-SBPartialInfo.plist --auto-activate-custom-fonts --target-device iphone --minimum-deployment-target 9.0 --output-format human-readable-text --compilation-directory /Users/daniel_sadjadian_2/Library/Developer/Xcode/DerivedData/BloodyTest-dqhxemnfmeljzncdtjhgruuqqnby/Build/Intermediates/BloodyTest.build/Debug-iphoneos/BloodyTest.build/Base.lproj /Users/daniel_sadjadian_2/Desktop/Test/BloodyTest/Base.lproj/LaunchScreen.storyboard
2015-09-21 10:12:34.619 ibtoold[596:7807] [MT] IBPlatformTool: *** Failed to launch tool with description <IBCocoaTouchPlatformToolDescription: 0x7fbceae543b0> System content 1x for IBCocoaTouchFramework-EightAndLater w/ default fidelity: Failed to find or create execution context for description <IBCocoaTouchPlatformToolDescription: 0x7fbceae543b0> System content 1x for IBCocoaTouchFramework-EightAndLater w/ default fidelity: Failed to find a suitable device for the type SimDeviceType : com.apple.dt.Xcode.IBSimDeviceType.iPad-1x with runtime SimRuntime : 9.0 (13A340) - com.apple.CoreSimulator.SimRuntime.iOS-9-0 (Failure reason: Failed to create SimDeviceSet at path /Users/daniel_sadjadian_2/Library/Developer/Xcode/UserData/IB Support/Simulator Devices. You'll want to check the logs in ~/Library/Logs/CoreSimulator to see why creating the SimDeviceSet failed.)
2015-09-21 10:12:34.678 ibtoold[596:7807] [MT] IBPlatformTool: Failed to write out diagnostics for marshalling failure: Error Domain=NSCocoaErrorDomain Code=516 "Failed to write out diagnostics for failure" UserInfo=0x7fbceb58c560 {NSLocalizedDescription=Failed to write out diagnostics for failure, NSUnderlyingError=0x7fbceb588110 "Failed to setup directory for failure diagnostics"}
/ com.apple.ibtool.errors */
/Users/daniel_sadjadian_2/Desktop/Test/BloodyTest/Base.lproj/LaunchScreen.storyboard: error: Could not open document
    Recovery Suggestion: Failed to connect with the iOS agent. Please file a bug report at bugreport.apple.com.
    Underlying Errors:
        Description: Failed to find or create execution context for description <IBCocoaTouchPlatformToolDescription: 0x7fbceae543b0> System content 1x for IBCocoaTouchFramework-EightAndLater w/ default fidelity
        Underlying Errors:
            Description: Failed to find a suitable device for the type SimDeviceType : com.apple.dt.Xcode.IBSimDeviceType.iPad-1x with runtime SimRuntime : 9.0 (13A340) - com.apple.CoreSimulator.SimRuntime.iOS-9-0
            Failure Reason: Failed to create SimDeviceSet at path /Users/daniel_sadjadian_2/Library/Developer/Xcode/UserData/IB Support/Simulator Devices. You'll want to check the logs in ~/Library/Logs/CoreSimulator to see why creating the SimDeviceSet failed.


The last few interesting points to note are as follows:


  • There is no option for mew to select an iOS simulator from the Devices list.
  • I opened "Window->Devices" and tried to add an iOS simulator, but whenever I select "Create", nothing happens.
  • Everytime I try to open one of the storyboard files in Xcode 7.0 - it crashes....


Thanks for your time, Dan.

I had this same error when building a command line build on my Jenkins based build server. This is the ONLY post online that I could find that was related. It appears that after I installed the iOS 8.4 simulator in XCode 7 that this problem went away. Hopefully that helps you as well!

Thank you so much for your reply.... I was feeling left out in the dark here.... Well I jsut tried that, I went into the Xcode preferences menu and downloaded the iOS 8.4 simulator.


The problem I have now is, how do I add it? I went to the "Windows -> Devices" menu and clicked the plus button to create an iOS 8.4 simualtor. But when I press the "Create" button in the popup, nothing happens.


Do you know how I can fix this? Also could this be related to the fact that when I try to just open the iOS simulator app, it just crashes and closes??


Thanks for your time 🙂

I'm not sure I can be of any help on this one...an 8.4 sim for all devices appeared in the list for me to run after installing 8.4 int he prefs menu. I am also able to create new simulators for iOS9 or 8 in Windows->Devices area. The simulator app just crashes eh? Are you running the latest version of Yosemite or El Capitan beta? And although I don't see it listed in things you tried, I assume you have tried cleaning/formating the simulator?

Ah right I see. Yes I am running the latest version of OS X Yosemite and Xcode 7.0 from the Mac App Store. I can't clean the simulator becuase when I open it, it just crashes. However, the watch simulator does open, but it just pops up with an error saying that no simulator/device exists, thus why I wanted to create one in the Devices menu, but alas that didn't work . Hmmm..... I have started to wonder if there is something wrong with my iOS simulator installation.


I know how to delete and re-install Xcode 7.0 (you simply delete it from the Applications folder and download/install it again from the Mac App Store)..... BUT..... how do you reset the "Library->Developer" folder? And how do you reset all the file associated with Xcode 7.0 which are stored in other locations on your Mac?


The reason I ask this, is because after re-installing Xcode 7.0 from the Mac App Store twice, I am still getting the exact same problem.... So yeah, I was thinking that maybe the Mac App Store doesn't reset the Developer folder and all the other simulator files/etc....


Do you know how to do a complete FRESH installation of Xcode 7.0 and ALL the related files that it needs?

iOS 9.0.1 has just been released.... I hope this means that there might be an Xcode 7.0.1 update.... If so, that might fix my issue.

There's probably more details you can google around. But maybe try deleting the ~/Library/Developer and /Library/Developer directories as well as xcode and reinstall it as well as the xcode command line tools. Also, have you tried xcode 7.1? beta 2 is out here https://developer.apple.com/xcode/download/

How do you do you reinstall the Xcode command line tools and whats the difference between "~/Library/Developer" and "/Library/Developer"?


Thanks 🙂

Accepted Answer

I finally got it to work!! After all the reinstalling/restarting/updating. Nothing worked. I noticed that some of the Xcode 7.0 files were for some reason corrupted. So for the 4th time, I reinstallted Xcode 7.0 and reinstalling Xcode componenets. I then waited for both the 7.0.1 update and OS X El Capitan. After updating to Xcode 7.0.1 and OS X El Capitan, all the issues were fixed!


Wahoo 🙂

Deleting the folders worked for me. (~/Library/Developer and /Library/Developer)

Another things I would check it's what command line you are using.


I had to use a different version and I changed them with :


sudo xcode-select --switch /Applications/Xcode8.app/Contents/Developer/


( You can also change it in the XCode/Preferences/Location )


I think my problem was that I was using the version 8.1


You can see the comand line you are using with:


xcode-select -p
Xcode 7.0 - Could not open document
 
 
Q