Storyboard won't open in XCode8 - interface-builder

I have a storyboard that opens fine in XCode7.3.1 but in XCode 8 will only open source code, it will not open in Interface Builder. Trying to open it in Interface Builder produces the error: The document "Main.Storyboard" could not be opened. Unrecognized file content.

Got a similar problem, although I had a never ending spinwheel, didn't even get an error message.
When I noticed not a single file of my project was changed when it stopped working I assumed a cache error somewhere, so in the end I 'fixed' it by restarting my computer (restarting XCode wasn't enough).
The joys of a .0 XCode version

Related

Interface builder storyboard compiler error Xcode

I downloaded Xcode and am getting "Interface builder Storyboard Compiler Error" when I try and run any project.
So far to troubleshoot this I have(based off any similar threads):
-cleaned the file
-created a new blank file (which still gives the compiler error message)
-uninstalled and reinstalled Xcode (Version 8.2.1)
-tried installing Xcode 8.3 beta 5 (still gives me the same error)
so far nothing has fixed this error.
Also I'm up to date on OS, running macOS Sierra version 10.12.3
I am learning swift for work and am hoping to get this figured out soon.
Thank you!
Xcode 8.2.1:
quit Xcode
delete .xcuserdatad folder inside xcuserdata of .xcworkspace(if using Cocoapods) or .xcodeproj
reopen Xcode, clean project and clean build folder (Under Product option)
That should be ok!
I had the same problem while trying to archive my app for the app store. I tried twice and same problem occurs.
Then i deleted the derived data, cleaned the project and restarted Xcode - THAT FIXED it.
Hopefully this will help someone else
I Solved the problem by cleaning the build folder.
Just use cmd + option + shift + k and then build the project by using cmd + B and hopefully solve the problem.
I was having this error for xCode 9.
An .xib file was creating the error.
What I did was,
removed .xib file
added it back to the project
cleaned and built the project
That solved my problem.
I also ran into this with XCode 9 Beta - 2, the quick nuke from orbit didn't fix it. Just check out the Log file it points you to and you can at least patch the offending issue, even if it a bug on Apple's end. For me, the TabBar didn't like an icon image, removed it for now and it Built fine.
I'll try replacing it yet with another image. Apparently it doesn't like its own System-provided Images.
Exception name: NSInvalidArgumentException
Exception reason: System-provided UIImage instances cannot be encoded
in NIBs - raised for instance '<UIImage: 0x7fd377eb4510>, {18, 20}'
None of the above suggestions worked for me. After further research I found that I had dragged a segue (popover) from a button inside of a tableview cell.
This is not allowed, as the touch anchor screen location is dynamic while the table scrolls.
I fixed the problem by anchoring the whole tableview instead and programmatically altering the popover arrow placement to be in line with the cell's button.
I just had the same problem.
After systematically removing objects from the xib I found that a button which was disabled and hidden created the internal error. After removing the button it works. (I tried to set the button back to normal : visible and enabled but that was not sifficient).
Hope that help you.
I have filed a bug report.
I have solved this issue by following below steps:
1. cmd + shift + k
2. cmd + option + shift + k
3. Restart Xcode
4. Restart you mac.
Hope this will also help you. Thanks!
I had this same error after updating to xcode 9.4. After doing a Product -> Clean and then Product -> Build still no luck. Then Done a clean again and restarted. After the reboot the build succeeded.
I use Xcode 9.4.1 and Xcode 10 beta 4 on macOS 10.14 beta 4. I opened the project that threw this error in both versions of Xcode.
While removing different files from bundle resources, I also got several other errors, such as "Interface builder XIB Compiler Error" and "Failed to launch IBCocoaTouchImageCatalogTool via CoreSimulator spawn".
After trying every other solution I could find, what finally worked for me is reinstalling Xcode 9.4.1, reopening the project and cleaning the project/build folder.
I speculate that this happened because there were times when both Xcode versions were open simultaneously. The two versions use common files and the simultaneous usage possibly caused an internal inconsistency in the rendering of Interface Builder.
I had this problem too, in Xcode 11;
In my case it happens after solving conflicts on .xcodeproject during merging code.
I followed below steps:
Remove storyboard from reference of project.
Select MyProject.xcodeproj and show content of that, then open
project.pbxproj by Xcode or text.
Search for storyboard name and removed all line contains that names.
Build project
Add storyboard to project.
Build project again.

Cmake Xcode project storyboard can not be loaded

I have been learning how to use CMake to generate a Xcode project. I found a nice example from https://github.com/forexample/testapp. When I generate Xcode project from this testApp. I always experienced "The document "MainStoryboard_***.storyboard" could not be opened. Unrecognized file content"
I have tried that I could open MainStoryboard_***.storyboard from Xcode if I only open this storyboard without open *.xcodeproj file. I have tried to change configuration in the info.plist and cmakelists.txt files, I didn't find a solution yet.
I wonder if someone experienced this issue before,
I ran into this issue whilst resolving a merge conflict between two storyboards. For me, all I had to do was manually resolve all the merges by opening the storyboard as Source Code and deleting the unwanted code and markers, but Xcode refused to open the file in Interface Builder until I shut Xcode and the simulator down entirely, re-opened them and then selected 'Open In Interface Builder' on the storyboard file.
I'm guessing your problem is more likely to be a bug in CMake, but I couldn't confirm this. I just wanted to drop this answer in for people who suffer this issue due to the same cause as myself.

My MainMenu.xib refuses to go into the bundle and my app crashes with: "Unable to load nib file: MainMenu, exiting"

When I run my application in Debug mode from Xcode it works, but when I run it in Release mode it crashes after outputting this:
Unable to load nib file: MainMenu, exiting
Indeed, MainMenu.xib is not present in either bundle (Debug nor Release) and if I look at the configuration it looks like it's missing:
It's been like that since I created the app from a fresh template but I didn't think much of it because in Debug it was working. I tried removing it and adding it again and it's still shown red, as missing.
In Deployment Info it says MainMenu although in the list it says MainMenu.xib. When I select MainMenu.xib it shows MainMenu:
Running by double clicking on the .app files has the same result as running it from Xcode.
What's wrong here? how do I fix it?
The environment is Xcode 6.2, a Cocoa application with Swift (OSX) and I'm running this in Yosemite (some other devs are running Mavericks).
Just for the record:
Unable to load nib file: MainMenu, exiting
was a real error but all the other symptoms that I saw were not relevant as #I'L'l commented in the question.
I am not sure what the actual problem was because the problem went away on its own after cleaning the project and rebuilding. I suspect a script that I had to generate DMGs might have been causing some issues. Also, I was expecting the .app that Xcode generated to work on other machines and that's not realistic. You need to properly re-archive the app for that to happen:
https://developer.apple.com/library/mac/documentation/IDEs/Conceptual/AppDistributionGuide/DistributingApplicationsOutside/DistributingApplicationsOutside.html

Xcode 4.6.2 error: "cannot run on the selected destination"

I've been having this problem for a couple weeks now. All of a sudden this happened to my project and I havent been able to fix it. Its a basic tab-bar app and i've barely even started heavy coding on it. Running xcode 4.6.2 (tried on 4.6 and 4.6.1 also).
The actual error says:
"Cannot run on the selected destination
The selected destination does not support the architecture for which the selected software is built. Switch to a destination that supports that architecture in order to run the selected software."
Thanks in advance.
Well here's my new fix: I had (for some reason) changed the highlighted line below:
I had changed the ${EXECUTABLE_NAME} to something else. Changing it back did not fix the issue immediately: I had to first click the + to add a new row then delete the new row.
My app runs fine now
OLD FIX:
OK, so yes, it's true, there are other questions like this one. They helped me figure out a different (and stranger) solution.
I right-clicked on my .xcodeproj file and chose "Show Package Contents"
I then opened "project.pbxproj"
I copied all the text from it to another file, deleted all the text from it and saved
This "crashed" my XCode Project that I had accidentally left open in XCode.
I closed my project, then pasted the original contents of "project.pbxproj" back into "project.pbxproj"
I saved "project.pbxproj" and closed it
After opening my XCode Project again, I was able to run it on my device!
To me, it doesn't make sense why this worked because I didn't modify an files... But it did, so hurrah!
PS
Back up your project beforehand, just in case.
EDIT: Well mine has stopped working again and I can't use the above method to fix it...

What is "Interface Builder Cocoa Touch Tool"

I got a code from a client to fix the bug (code was written by some other programmer), So when I open the xib file it simply hang my computer, i restarted my computer 3 times because of that and finally decided to see what's happening by opening the Activity Monitor and it turn out it is opening something with name "Interface Builder Cocoa Touch tool" and its eating all of my computer memory. Below is the screenshot.
But here is the interesting thing, it is not opening "Interface Builder Cocoa Touch tool" when open "xib" files from other projects, and i can't say anything about this project because this project has only one "nib" file.
But if kill that process, it open the nib file but an error start firing on me after every 10 sec. Below is the screen shot.
Note: App was written initially for ios 2.0 version and we are trying to move the project to ios 4.0. Is this thing has anything to do with this?
The best course of action here is to create a bug report at http://bugreport.apple.com/, uploading your broken nib file as an enclosure. That doesn't get you working again, so try one of these:
see if you can convince ibtool to write a working file, perhaps by doing some refactoring like changing one of the classes used then changing it back
find out whether the client is on the same version of Xcode: if theirs is newer, upgrade
use xmllint to see whether the xib is valid XML, and if not whether you can fix it in a text editor
recreate the xib from scratch if it isn't too complicated

Resources