Ios – Your binary is not optimized for iPhone 5

iosiphonexcode

I am trying to submit my first app to the App Store but when I try I am getting the following error:

ERROR ITMS-9000: "Your binary is not optimized for iPhone 5 – New
iPhone apps and app updates submitted must support the 4-inch display
on iPhone 5 and must include a launch image referenced in the
info.plist under UILaunchImage with a UILaunchImageSize value set to
{320, 568}. Launch images must be PNG files and located at the
top-level of your bundle, or provided within each .lproj folder if you
localize your launch images.

Inside Images.xcassets there is no LaunchImage files.

I have no idea what is wrong, I am using the LaunchScreen.xib for my launch screen and it's working on my iPhone 6 and iPhone 5 screen. I am using Xcode 6.0.1 (6A317).

Any clues of what may be wrong?

Thanks!

Best Answer

This problem appears when you use a xib or storyboard as your launch screen. This was a new feature for iOS 8 (so it's not available in iOS 7). Since Apple didn't drop yet support for iOS 7, they maintain the need to supply the Launch screens for this version also.

You can change to Images.xcassets as the chosen answer is, but then if you want to use LaunchScreen.xib (as you invoked) for iOS 8+ devices, all you need to do is to create also the LaunchScren images the old way:

  • add to your plist file the a new row named UILaunchImages of type Array.
  • add a new item in your array (Item 0) of type Dictionary.
  • add a new item in the Dictionary with the key UILaunchImageName and the value Default.
  • add to your bundle 2 images named : Default-568h.png of size (320x568) and Default-568h@2x.png (640x1136).

If you want your app to run on other older devices with iOS 7, you can add also the 4s size, iPad size etc. as the Default images.