简体   繁体   中英

XCode no valid compiled storyboard at path

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:

  1. Go to Project Target -> Info and then delete KeyValue object for key Main storyboard file base name and Main storyboard file base name (iPad) .
  2. 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.
  3. Remove references to Storyboards from Xcode project.
  4. 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.
  5. 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.

由于状态栏样式的故事板颜色的更改而在项目设置中未更改,因此出现此问题

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 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM