Home > Software engineering >  Xcode 13.3 Not Linking Storyboards
Xcode 13.3 Not Linking Storyboards

Time:04-09

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.

CodePudding user response:

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.

  • Related