17

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.
Forge
  • 6,538
  • 6
  • 44
  • 64
bilby91
  • 904
  • 1
  • 8
  • 20
  • possible duplicate of [Interface Builder could not open the document ".xib" because it does not exist](http://stackoverflow.com/questions/8968715/interface-builder-could-not-open-the-document-xib-because-it-does-not-exist) – DanSkeel Dec 02 '14 at 16:01

17 Answers17

20

I could fix this bug by killing ibtoold:

$ sudo killall -9 ibtoold

Why does ibtool need a daemon anyway?

Nikolai Ruhe
  • 81,520
  • 17
  • 180
  • 200
  • Checkout [my answer](http://stackoverflow.com/a/19299619/991816) with useful related links (scripts and articles). – DanSkeel Dec 02 '14 at 16:19
13

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.

tdelepine
  • 1,986
  • 1
  • 13
  • 19
  • The storyboard is in "Copy Bundle Resources" in both targets, i forgot to mention i tried this before, sorry. – bilby91 Sep 17 '13 at 22:08
  • how to load you the storyboard or uiviewcontroller ? – tdelepine Sep 17 '13 at 22:21
  • I don't think this is a runtime problem, either way, this is how i load my storyboard. UIStoryboard* s = [UIStoryboard storyboardWithName:@"LOOVProductIndex" bundle:nil]; – bilby91 Sep 18 '13 at 14:48
  • I remember once ago i had a problem with the letter case between Project navigator and file name in finder check it perhaps – tdelepine Sep 18 '13 at 15:09
6

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.

MBT
  • 21,733
  • 19
  • 84
  • 102
smit mehta
  • 101
  • 1
  • 4
  • I encountered same issue and I resolved like this, now the problem is I can't open storyboard file Interface Builder. When I click on the file it shows the xml contents not the views and scene. Did you face the similar issue ? – Anees Feb 20 '20 at 06:36
5

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.

nishant
  • 736
  • 1
  • 12
  • 22
  • Please, this is quite unclear to me. I see location for file inspector for both Project and Target and they both don't have the option *Relative to Group*. – nyxee Jul 28 '17 at 05:00
4

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
Scott Gardner
  • 8,603
  • 1
  • 44
  • 36
4

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!

Mike H
  • 181
  • 1
  • 7
3

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
quarac
  • 3,454
  • 3
  • 21
  • 25
3

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

ninahadi
  • 432
  • 6
  • 9
2

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.
Amit K Bist
  • 6,760
  • 1
  • 11
  • 26
1

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.

Adam Ritenauer
  • 3,151
  • 4
  • 33
  • 40
1

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

enter image description here

Noam Segev
  • 395
  • 3
  • 20
1

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

Firda Sahidi
  • 1,227
  • 1
  • 11
  • 22
0

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.

bilby91
  • 904
  • 1
  • 8
  • 20
  • 1
    lucky me, it took me mere millions! – jd. Sep 21 '13 at 04:14
  • Very strange, but the following post suggests that it will work again after some time. Maybe that is what fixed it for you. In my case, I tried to leave my project for some minutes, and then it worked again. Before that I did clean and build, but without success. https://groups.google.com/forum/#!topic/rubymotion/qPMNifK6UfE – Vanja Oct 17 '13 at 09:49
0

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 :)

jd.
  • 1,142
  • 8
  • 14
  • This makes a lot of sense, i had some inconvinients with permissions and keychain little time ago! – bilby91 Sep 22 '13 at 04:57
0

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

aimak
  • 540
  • 2
  • 12
0

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.

Venu Gopal Tewari
  • 5,672
  • 42
  • 41
0

In my case, folders in the project navigator and finder were not formed exactly the same. The Main.storyboard was in \Views folder in the project navigator but not in finder. Xcode wouldn't let me quit the app, because Main.storyboard couldn't be saved. Here's what I did, that solved this problem:

  1. Identify which files are missing or misaligned in your project navigator and finder simultaneously.
  2. Copy Main.storyboard and other files that are not in their right place to a safe location.
  3. Force quit Xcode from Activity Monitor. Reopen Xcode.
  4. Paste previously copied files in finder. Make sure that the folder order is the same as the Xcode project navigator.
  5. In Xcode, from project navigator right-click to where you need to add files and click add new files.
  6. Add files from the finder.
  7. Clean and build.
active_sludge
  • 216
  • 2
  • 5