19

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!

Eric Aya
  • 69,473
  • 35
  • 181
  • 253
Jose Zamudio
  • 865
  • 1
  • 8
  • 22
  • 1
    Apple's error messages tend to be pretty clear. Work through the message you have and make sure your bundle meets all their requirements. –  Oct 15 '14 at 03:26
  • 2
    Does your app support iOS 7 or earlier in addition to iOS 8? If so you need the 4" launch image, just as described in the error message. – rmaddy Oct 15 '14 at 03:27
  • It does, it's iOS 7+, where does that image go? And how would I reference it in the info.plist? @rmaddy thanks – Jose Zamudio Oct 15 '14 at 03:29
  • I followed the answer in this post: http://stackoverflow.com/questions/18976412/launch-screens-supporting-ios6-and-ios7-forced-to-splash-screen – Jose Zamudio Oct 15 '14 at 04:16
  • I have the same error with deployment target iOS 8. What's wrong on that case? http://stackoverflow.com/questions/27136053/cant-submit-the-app-to-the-app-store-your-binary-is-not-optimized-for-iphone-5 – Dmitry Nov 25 '14 at 20:27
  • @Altaveron I had to add launch images for all display sizes because not all of them rely on the LaunchScreen.xib, only iPhone 6 and 6 Plus (maybe iPhone 5 too?) does! :) – Jose Zamudio Dec 03 '14 at 06:30
  • Possible duplicate of [Xcode error while validation - "Your binary is not optimized for iPhone 5"](http://stackoverflow.com/questions/23780432/xcode-error-while-validation-your-binary-is-not-optimized-for-iphone-5) – bummi Jan 23 '16 at 09:53

6 Answers6

27

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.

Dan Bodnar
  • 487
  • 6
  • 9
  • very useful for me. Thanks – Nijat2018 Dec 15 '15 at 15:01
  • fast forward to 2016, re-generating the Launch Image source resolved the issue. I mean xcode automatically handles it. I had to drag drop Default-x images though. http://stackoverflow.com/questions/23780432/xcode-error-while-validation-your-binary-is-not-optimized-for-iphone-5 – Piyush-Ask Any Difference Jan 27 '16 at 17:09
  • OH ok, it works. i couldn't before because i was missing the h in 568h.png – htafoya Jun 11 '16 at 23:41
  • This solution really saved my time. Whole day I spent time on solving issue and finally solved by changing deployment version to iOS 8.0 from 7.1. Thanks! – Purushottam Padhya Sep 07 '17 at 10:47
7

If you are working with Images.xcassets make sure in your projects settings, General > App Icons and Launch Images > Launch Image Source is set.

David
  • 3,388
  • 2
  • 21
  • 25
3

I had a slightly corrupted PNG that was causing the issue - everything else was totally fine.

Basically the automated export feature from a PSD I was using exported as a JPG and I changed the extension to PNG and whilst it looked like it was okay and loaded fine in in Preview, but the file wasn't a legit PNG.

TL;DR check that your assets are valid.

Phil Hudson
  • 3,819
  • 8
  • 35
  • 59
3

add the below in info.plist

<array>
<dict>
<key>UILaunchImageName</key>
<string>Default</string>
</dict>
</array>

And also add 320x568 and its 2x image, 640x1136 for iPhone and for iPad 768x1024 in the source bundle. If these are not done Validation will result in errors.

Neha Vipin
  • 688
  • 6
  • 17
0

You can refer the solution via this link

Your binary is not optimized for iPhone 5

The problem has solved when I do this:

  1. I have removed laungh images' xcassets totally
  2. added the launch image set
  3. and added all launch images again
  4. created a new ipa again

and this time its successfuly submitted.

0

My splash image was set as 320x568, I changed it to 568x320. Fixed the problem. So simple, and so much time burned.

My file had the name: Default-568h~iphone.png (the word "Default" is interchangeable with almost anything)

I was exporting/publishing via Adobe Animate

airvine
  • 631
  • 8
  • 23