Invalid info.plist - UIMainStoryboardFile or NSMainNibFile when sending an app to app store
Asked Answered
D

8

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!

Dissimilar answered 18/4, 2013 at 12:27 Comment(0)
M
9

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

enter image description here

Mccall answered 25/6, 2018 at 3:50 Comment(0)
C
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

Cesena answered 19/6, 2013 at 3:32 Comment(1)
In addition to your answer, I've changed <key>NSMainNibFile~ipad</key> to <key>UIMainStoryboardFile~ipad</key> in the Info.plist file.Psychologism
M
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).

Middleman answered 16/10, 2013 at 4:59 Comment(3)
I also had to make a copy of first storyboard as MainStoryboard-iPad.storyboard.Physical
In my case, I created a new Storyboard but yeah, copying your iPhone storyboard can also be a sensible answer. Thanks!Middleman
Thank you @OlivaresF, this answer saved me. I had switched an iPhone app to a universal app, but was using the same storyboard.Off
O
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.

Orsa answered 3/1, 2014 at 12:58 Comment(0)
N
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

Novelia answered 8/7, 2019 at 19:59 Comment(0)
P
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.

Psychologism answered 17/10, 2019 at 19:15 Comment(0)
T
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;
}
Tamica answered 1/2, 2014 at 10:23 Comment(0)
A
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.

Alecto answered 2/12, 2014 at 11:7 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.