Interface Builder could not open the document “.st

2019-02-08 03:30发布

This problem is getting me really crazy. Xcode is looking for a storyboard in my project in a differente location from my project. I tryed removing the file, adding it again, cleaning the project, etc but didn't have luck.

This is the error.

cd /Users/fmartin91/Projects/loovin/loovin-ios
setenv IBSC_MINIMUM_COMPATIBILITY_VERSION 7.0
setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
setenv XCODE_DEVELOPER_USR_PATH /Applications/Xcode.app/Contents/Developer/usr/bin/.. 
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/ibtool --errors --warnings --notices --minimum-deployment-target 7.0 --output-format human-readable-text --compile /Users/fmartin91/Projects/loovin/loovin-ios/Build/Products/Debug-iphonesimulator/loovin.app/Base.lproj/LOOVProductIndex.storyboardc /Users/fmartin91/Projects/Base.lproj/LOOVProductIndex.storyboard


/* com.apple.ibtool.errors */
/Users/fmartin91/Projects/Base.lproj/LOOVProductIndex.storyboard:
error: Interface Builder could not open the document
"LOOVProductIndex.storyboard" because it does not exist.

16条回答
Deceive 欺骗
2楼-- · 2019-02-08 04:10

In my case I found that the storyboard was placed in a group that referenced a folder that did not exist in the "Identity and Type" panel.

Removing that group and the storyboard, and adding it back referencing an existing folder solve the problem for me.

查看更多
在下西门庆
3楼-- · 2019-02-08 04:11

I just ran into this issue running Xcode 9.2. I had copied my files from a school computer onto google drive and then downloaded them at home.

When I opened the files at home it kept telling me main.storyboard and the launch storyboard did not exist. The two storyboard files would display as xml, so they clearly existed, but even right clicking to "open as" produced nothing. After much troubleshooting I found a fix that worked for me.

SOLUTION:

Open your project folder, then the next folder named the same as your project. Open Base.lproj and you will see your two storyboards in xml format. Copy both the files, paste them into the same folder, delete the .xml and confirm the change to .storyboard. Do this for both files and you're set!

查看更多
欢心
4楼-- · 2019-02-08 04:12

Goto Build Phases > Copy Bundle Resources > Check for the Storyboard for which you are getting error > It should be displaying as blurred > If YES then delete its reference and add it again > Compile again.

查看更多
狗以群分
5楼-- · 2019-02-08 04:12

I resolved this by doing this:

  1. Open your Xcode project folder in finder, then find the file that you can't open.

  2. Drag that file to your file path in Xcode Project (Inside Xcode App) like this.enter image description here

  3. Thick "copy item if needed" and choose "create folder references" and then click finish. enter image description here

  4. Restart Xcode

查看更多
登录 后发表回答