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条回答
做个烂人
2楼-- · 2019-02-08 03:56

I could fix this bug by killing ibtoold:

$ sudo killall -9 ibtoold

Why does ibtool need a daemon anyway?

查看更多
我只想做你的唯一
3楼-- · 2019-02-08 03:57

I had a very similar problem and it took a few hours to resolve. Clearly xcode locked itself in some strange state that the project explorer could see the xib file while the compile could not. Finally this got resolved when I changed the Location in the File Inspector from Relative to Group to Relative to Project. I got this by comparing the project.pbxproj file in a regular text editor to search for any clues.

查看更多
小情绪 Triste *
4楼-- · 2019-02-08 04:00

Your storyboard is not in NSBundle mainbundle. this problem is probably due a "Copy Bundle Resources" in "Build phases" problem.

For corrected it verify if your storyboard file is in "Copy Bundle Resources" for all targets. On project navigator select the project file select Build phases tab and check it is.

查看更多
Fickle 薄情
5楼-- · 2019-02-08 04:04

When you upload your file to google drive without zip, it appends the extension of .storyboard to .xml automatically and hence when you download it obviously the file won't exist.

To solve this issue, go to the:

[project folder] > [Project folder] > [Base.lproj]

There would be a .storyboard.xml extension type of file which you would have to rename it to the .storyboard extension. And hence your work is done.

Story board error solving visual guide:

Story board error solving visual guide.

查看更多
疯言疯语
6楼-- · 2019-02-08 04:06

I experienced the same situation with Xcode 7 beta 5. Rebooting my Mac did the trick.

查看更多
SAY GOODBYE
7楼-- · 2019-02-08 04:07

For me I use xcode 10, Click on the your project name (blue icon on left) > Build Phases > Under Copy Bundle Resources

Find the file, remove the duplicates if it’s there. Clean project and run again

查看更多
登录 后发表回答