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条回答
Viruses.
2楼-- · 2019-02-08 03:47

I encountered same problem when moving the project to another computer. I followed below steps to solve this issue:

  • Open previous Main.storyboard file as Source Code, copy all
  • Create a new Main.storyboard file, Open as Source Code, paste
  • Delete previous Main.storyboard
  • Clean and build project.
查看更多
Rolldiameter
3楼-- · 2019-02-08 03:50

This happened to me after a git merge. I changed some storyboard localized files from one project to another and Xcode seems to keep on searching the file in the old project.

My solution was:

  1. Edit the OldProjectName.xcodeproj/project.pbxproj
  2. Search for the Storyboard name
  3. Delete the references to the Storyboard name that appear followed by localization stuff (things like "Base.lproj", "es.lproj", etc)
  4. Delete also the following localization entries (because they refer to the Storyboard file)
  5. Clean and build
  6. Repeat if other files keep throwing compile errors
查看更多
聊天终结者
4楼-- · 2019-02-08 03:50

I could solve my issue, i really don't know how i did it but the things i tried were cleaning and building the project like a billion times, i hope this will be of help to anyone.

查看更多
ゆ 、 Hurt°
5楼-- · 2019-02-08 03:52

I just experienced this, and fixed it by restarting the darn computer. I found out more about it, though. In my case, my ibtool scripts weren't working, giving file-not-found errors just like yours. However I noticed a change in behavior when I ran them as sudo:

2013-09-20 20:49:40.339 Interface Builder Cocoa Touch Tool[58454:303] CFPreferences: user home directory at file:///var/root/Library/Application%20Support/iPhone%20Simulator/User/ is unavailable. User domains will be volatile.

Subsequent commands would fail or return without doing anything. So! ibtool/Interface Builder/whatever is somehow using some other launching service to run itself, with some other username or privileges.

Could it be that I installed some tool updates for Xcode 5.0, and it screwed up whatever serving process was running? Yes it could :)

查看更多
Juvenile、少年°
6楼-- · 2019-02-08 03:53

For me resetting the container folder of Main.storyboard file worked

enter image description here

查看更多
成全新的幸福
7楼-- · 2019-02-08 03:54

I encountered this same issue and here's how I resolved it:

  1. Save a copy of the affected file outside of the project
  2. Delete the file from the project, selecting Move to Trash to completely delete the file and reference from the project
  3. Edit ProjectName.xcodeproj/project.pbxproj to remove all lines referencing the affected file
  4. Re-add the file, making sure to check Copy items into destination group's folder (if needed)
  5. Clean and build
查看更多
登录 后发表回答