When I make changes to the MainStoryboard.storyboard none of these changes make it to my iOS device even though it builds. I tried deleting all data for the application from the device and restarting everything but now when I build and run the code on the iPhone I get the following error:
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Could not find a storyboard named 'MainStoryboard' in bundle NSBundle </var/mobile/Applications/BE0CBEE9-1E95-443A-97CF-53CCD66A2D0C/WalkBack.app> (loaded)'
From what I can tell, my plist file has the appropriate information for the name of the storyboard.
Any ideas what is wrong, or how can I fix it? Right when this problem happened the .xcodeproj file started opening in XCode 3. Did this mess up some settings? I'm terribly lost.
I've seen this happen a handful of times with the files with my students, and today I had it happen to me as well. What seems to fix it for me:
Right-click on your MainStoryboard.storyboard in the Project Navigator.
Select Delete and click Remove References Only.
Right click on InfoPlist.strings and select "Show In Finder". (This is just my lazy way to open the folder containing the storyboard in finder.)
Drag the MainStoryboard.storyboard from Finder back into the project.
My suspicion is that there is a bug somewhere triggered by adding files to the project or certain edits to the storyboard. It causes the localized files to not be copied into the bundle (I think). Removing the storyboard and re-adding it to the project seems to fix the hiccup.
I have universal app, so with one storyboard for iPhone and another one for iPad, iPad simulator works, but when i try to lunch iPhone simulator i obtain this error:
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Could not find a storyboard named 'MainStoryboard' in bundle NSBundle </var/mobile/Applications/BE0CBEE9-1E95-443A-97CF-53CCD66A2D0C/WalkBack.app> (loaded)'
I tried all your solutions but anyone didn't work. I always had same error.
I solved removing localization parameter on iPhone storyboard and setting for both storyboard the same localization.
I hope that helps you!
There is another way!
Go to your project, select your target and click on Build Phases.
Then unfold "Copy Bundle Resources" and add the MainStoryboard.storyboard to the resources.
You can do this by clicking on the little '+' sign on the bottom of the unfolded list.
You don't have to delete the file from your project just re-add it to the resources.
You could always also reset the simulator.
Actually, to be even more precise, you will find that you are unable to add MainStoryboard.storyboard [it does not show up in the file browser] to the "Copy Bundle Resources" section of the Build Phase setting. I found that I actually had to add it the "Compile Sources" section of the Build Phase setting. It then adds it to both sections. I am not sure whether this is the intended behaviour or a bug in Xcode 4.6.3.
Related
I have a project that builds and runs with no issues when using Xcode 13.0. However, if I close 13.0, and try to then build and run the project using Xcode 13.3, the app will build, but then crash immediately on launch with the following error:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Could not find a storyboard named 'Main' in bundle NSBundle
I'm making no changes in the project at all - the only change being the version of Xcode used to build the app. When comparing the build output between the two versions of Xcode, I have noticed that 13.3 is skipping the "Link Storyboards" step.
A few things that I've tried include:
Removing the storyboard file from the .xcodeproj, and re-adding it.
Removing all localization from the project, thinking it may be related to that. I then tried re-enabling localization.
Creating a brand-new storyboard using the File > New> File… menu. Even the new .storyboard files are not linked or added to the project.
Removing and then re-adding the .storyboard files to the Copy Bundle Resources build phase.
Bumped the minimum deployment target from iOS 13.0 to 14.0
Cloned my source code from Git to a new location and built from there.
Product > Clean Build Folder and manually deleted the derived data folder locations more times than I can count. I'm using the default Derived Data location. (~/Library/Developer/Xcode/DerivedData)
I've been able to verify that the storyboard files are not being included in the finished app by inspecting the .app bundle after the build succeeds. All other resources I've been copying to the app are there, but the storyboards are not.
Has anyone else seen this issue, and if so, resolved it? I've been stumped for a few days now, and so far, the only thing that's worked has been rolling back to Xcode 13.0.
Fixed it. Turns out that a few years ago, a User-Defined build setting for CONFIGURATION_TEMP_DIR had been defined in our project. Removing this setting, and falling back to the default value got our project running again with no issues. I'm not sure why this setting had been defined originally, but apparently Xcode 13.3 just doesn't like it anymore.
This line also affected another project of ours, that doesn't use storyboards, but does have an Apple Watch app. In that case, the crash was similar, with the error stating that an Interface.plist file could not be found.
Apple's (archived) doc on the setting.
Here is the full message i got:
Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Could not load NIB in bundle: 'NSBundle </private/var/mobile/Containers/Bundle/Application/EA93D8D1-339F-4007-A5AA-671461179671/******.app> (loaded)' with name 'a0J-YD-TZi-view-qwI-Ja-FwJ''
I had searched a lot of answers about 'Could not load NIB in bundle',my condition seems different from these,i have never used a nib named a0J-YD-TZi-view-qwI-Ja-FwJ in my project. there are two storyboard in my project(Main_iPad,Main_iPhone), and the app works well on iPhone and iPhone simulator.
any help will be appreciate!
Try resetting the Simulator and also cleaning your build folder.
Another problem could be that the nib is part of the bundle resources that are copied to the app during building. Can you check if the file is included in the Copy Bundle Resources build phase?
Might be this is happening due to iOS is case sensitive, simulator is not. Make sure you use the correct file names, . so if it works in simulator but not on device check the cases on the file name.
Another thing is when you add a new file to the project xcode will automatically add it to the "Copy Bundle resources" section of your target.
Sometimes, if you are collaborating with another person the project.pbxproj will get out of sync and this entry will get removed. The fix is to ensure that all the files in the Resources folder (that are required in the release) are also present in the "Copy Bundle resources" section, and if it isn't just drag it from the resources to that section.
I've got a universal XCode Project (ObjC) for iPad and iPhone with a subproject that contains a storyboard.
The subproject is a static library that has been added to the main project. Included in this subproject is a bundle containing bespoken storyboard.
Whenenver I tap a certain button the application, the storyboard needs to be loaded;
[UIStoryboard storyboardWithName:#"UIControls.bundle/Config" bundle:nil];
That works perfectly fine for the iPhone (devices and simulators), but whenever I try to run the project an an iPad (device or simulator), I'm getting the following error;
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'There doesn't seem to be a valid compiled storyboard at path...
What's the about? The project is a universal project, so why can't the iPad find the storyboard?
To answer my own question;
This error appears when the bundle target isn't universal.
So make sure the Targeted Device Family in the bundle's build settings is set to iPhone AND iPad.
Just ran into this, after switching a project from a Universal target to iPad only, and the deployment target from iOS 9.0 to iOS 7.1.
The solution was to disable 'Use Size Classes' on the storyboard, and only keep the sizes for iPad.
To get to this checkbox, open the storyboard in the project navigator, then select then show the File Inspector (first icon) and scroll down to Interface Builder Document heading.
I was using a Storyboard from a custom Cocoapod and it kept crashing with
There doesn't seem to be a "valid compiled storyboard" at path ...
In the affected storyboard, under Interface Builder Document I switched the "Builds for" value from "iOS 7.0 or later" to "Project Deployment Target" (which was 9.0), this did the trick for me.
I'm sorry for my previous comments.
I don't know why it didn't work, but currently I fixed that problem with following steps:
Go to Project Target -> Info and then delete KeyValue object for key Main storyboard file base name and Main storyboard file base name (iPad).
To ensure that it's completely removed, go to Info.plist file and verify the KeyValue objects aren't exist there. If they are, then also delete from there.
Remove references to Storyboards from Xcode project.
Add Storyboards back to the project by right-click on the project in Xcode -> Add files to project_name, tick the Copy items if needed, Create groups and project target options.
Set Storyboards names both for iPhone and iPad in Project Target –> Info, by adding previously removed KeyValue objects.
From now Storyboards work as previously!
I was trying to fix this problem for 2 days with no hope till i found that it also did not open the sqlite DB file also and after that everything is corrupted after this DB failure. that was my case. And all of that was a memory issue even if ARC set arrays or dictionaries after finishing to nil;
In our case, we were running a shell script that executed one of XCode's commandline tools, ibtool,
ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target 6.0 --output-format human-readable-text --compile ./Build/Release-iphonesimulator/TestApp.app/TestStoryboard.storyboardc ./Resources/TestStoryboard.storyboard --sdk /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.2.sdk
and while it seemed to run without errors, it actually produced an empty storyboardc directory. Upgrading the minimum deployment target to 8.0 produced a properly constructed storyboardc, with an Info.plist file inside. When IBTool fails / produces an empty directory, I definitely think it should actually fail, and cease compilation, because otherwise everything looks like it's properly set up and correct, it actually isn't.
So yeah, solution for us was upgrading the minimum deployment target of our app.
I had this problem due to changes in the Storyboard color of Status Bar Style and not changed in project settings
For me solution is:
I used this code to load a new view controller - [UIStoryboard storyboardWithName:#"UIViewController" bundle:nil];
First I tried - [UIStoryboard storyboardWithName:#"UIViewController" bundle:[NSBundle mainBandle]];
But no lucky, finally I changed this code to:
[self performSegueWithIdentifier:#"Segue" sender:self];
And it helped, maybe it can help somebody too.
Had the same issue. Solved it buy adding libc++.tbd in Link Bindary with Libraries.
After Xcode Update (5.1) my app crashes when i try to run in iOS 6.x.
I have an app where I have a custom cell and constraints.
Auto layout is unchecked for the xib file. The error I get is:
*** Terminating app due to uncaught exception 'NSInvalidUnarchiveOperationException', reason: 'Could not instantiate
class named _UITableViewCellSeparatorView'
I only found one thread about this issue in another forum, but without a solution, just a test that I've done too and got the same error.
I was getting the same error after updating to Xcode 5.1.
I was able to get rid of the error by editing the xib for my custom cell.
Under Interface Builder Document in the file inspector, I switched "View as" to "iOS 6.1 and Earlier". I also have "Builds for" set to "iOS 6.0 and Later".
I got same issue and "View as" and "Builds For" didn't help me. I changed "Opens in" - "Xcode 5.0" and it helped.
PS Don't forget to remove app from device/simulator, clean project and restart xcode (not sure which way was right, I did all of them)
After installing of Xcode 6.0.1 beta 2, I too was encountered with this problem.
My project has iOS Deployment Target is 6.0
Using answer of #AlexZd, I did next actions:
I found all xibs, which will created / displayed at this moment
Before my actions this xibs had next standard settings:
So, for every of xibs, selected by me, this settings was changed on next settings:
Now, check work of it. If this does not works, then do control actions
4.
1) Clean your Xcode project by CMD + SHIFT + K,
2) Clean ~/Library/Developer/Xcode/DerivedData folder by hands
3) Remove app from device and then run it via Xcode on this device
This solution was checked by me on 3 iPads with IOS6, IOS7 within IOS8 too. This works perfectly on any of them!
Seemingly, out of the blue, I am now getting this message:
Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Could not load NIB in bundle: 'NSBundle </var/mobile/Applications/CC7C18ED-8A1D-4548-86F1-B868B50D2535/YesTheApp.app> (loaded)' with name 'ECLNameAndattributeCell''
When I look in Copy Bundle Resources in Build Phases (as suggested by other similar questions) I see the following. All my other nib files are showing that they are in my app but ECLNameAndAttributeCell.xib is the only one that has no text after it.
Nor is it listed in the list of files that I could add.
I also looked at its Kind in Finder and it said it was an Interface Builder XIB Document. How do I check the File Type in Xcode? I read to right click on the file in Xcode. Is that control-click? I don't see any option to check the file type with a control-click in the menu that appears.
BTW, the app seems to run fine on the simulator after I removed and reinstalled the app on the simulator. But it consistently crashes on the iPhone, even after removing and rerunning the app on the iPhone.
Can someone explain what is going on and what I should do?
I appreciate your help.
You're spelling it wrong, it's ECLNameAndAttributeCell, with a capital A on Attributed.
Yes, right click is control click.
You need to show the File Inspector, then select the file in the Project Navigator, The File Type should be the second line in the inspector. This will also allow you to see check the file localization and target membership. If the target membership is not correct, the file may not be getting updated.