17

While sending an app to the app store I received a message stating:

"Invalid info.plist: the info.plist may contain either UIMainStoryboardFile or NSMainNibFile, but must not contain both keys"

After googling around it seems the consensus is to set the "main nib file base name" to "MainWindow" and also to set the "main storyboard file base name" to "MainStoryboard_iPAd". Both options we already have.

The app is designed to run on both iPad and iPhone and the app contains two storyboard files, one for ipad and one for iphone. I cannot find any visible .nib or .xib to manipulate even if I found the correct answer.

Does anyone have any hints on how to work around/fix this so the app will send?

Thanks heaps!

MalsR
  • 1,197
  • 1
  • 12
  • 23
bldysnw
  • 171
  • 1
  • 1
  • 5

8 Answers8

9

Here is what helped me resolve this issue. Delete the NIB entries.

enter image description here

spdrman
  • 1,372
  • 2
  • 13
  • 18
7

As the message suggests, you should not have both UIMainStorboardFile and NSMainNibFile set in your Info.plist file. I would suggesy you remove the NSMainNibFile entry.

Since you have two storyboards, one for iPad, and one for iPhone, you can set them as the Main Storyboard separately in the Summary tab of your project:

enter image description here

Valent Richie
  • 5,226
  • 1
  • 20
  • 21
7

Unfortunately, @verbumdei's answer did not work for me.

I was trying to turn an iPhone-only project to Universal in iOS 7 and it wasn't working. The iPad's storyboard wasn't being read.

What happened was that Xcode added a key to my .plist that was "Main nib file base name (iPad)". I had to delete that key and add "Main storyboard file base name (iPad)", then set the filename to my storyboard's (i.e. Storyboard-iPad.storyboard).

olivaresF
  • 1,369
  • 2
  • 14
  • 28
  • 1
    I also had to make a copy of first storyboard as MainStoryboard-iPad.storyboard. – WebOrCode Oct 16 '13 at 05:27
  • In my case, I created a new Storyboard but yeah, copying your iPhone storyboard can also be a sensible answer. Thanks! – olivaresF Oct 17 '13 at 14:35
  • Thank you @OlivaresF, this answer saved me. I had switched an iPhone app to a universal app, but was using the same storyboard. – drc Nov 12 '13 at 10:57
4

Check info -> custom IOS target properties

Check Main nib file base name(iPhone/iPad) or Main Storyboard file base name(iPhone/iPad)

If not exist, add them and write your base file name.

It works for me.

AlexB
  • 7,302
  • 12
  • 56
  • 74
Newkie
  • 399
  • 2
  • 15
1

For those with problems, I solved without creating a new key, just removed the (iPad) from the existing key

In Main Interface I selected the Storyboard, saved, cleaned the project and voila

1

As of Xcode 11 go to Info -> Custom iOS Target Properties -> Find Main nib file base name (iPad) and leave value for this key empty. Also, in General -> Deployment Info -> Main interface your value should be empty.

Daniel Danielecki
  • 8,508
  • 6
  • 68
  • 94
0

None of the above solutions worked for me.
Therefor what I did was that i added a storyboard property to the AppDelegate and set its value in - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
Below is the code for this:
AppDelegate.h

@property (strong, nonatomic) UIStoryboard* storyboard;  

AppDelegate.m

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];

    if ([UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPad) { // is iPad
        self.storyboard = [UIStoryboard storyboardWithName:@"Storyboard_ipad" bundle:Nil];
    } else {
        self.storyboard = [UIStoryboard storyboardWithName:@"Storyboard_iphone" bundle:Nil];
    }

    self.window.rootViewController = [self.storyboard instantiateInitialViewController];

    [self.window makeKeyAndVisible];

    return YES;
}
S1LENT WARRIOR
  • 11,704
  • 4
  • 46
  • 60
0

By default Xcode creates 'Main nib file base name (iPad)' in info.plist file and assign it with name of your iPad storyboard.

Here is resolution Open Info.plist file-> delete 'Main nib file base name (iPad)' and add another key with name 'Main storyboard file base name (iPad)' and assign it with name of your iPad storyboard file i.e. Main_iPad don't provide extension.

Amit Limje
  • 41
  • 3