Search code examples
iosobjective-cxcodeswiftlaunchimage

Your binary is not optimized for iPhone 5 xcassets


First thing: i read the other answers to this common problem but they didn't solve my issue, so i'm asking here cause i can't understand why it doesn't work.

As you can imagine, my problem is:

error displayed

I'm using xcode 6 and Swift as language. I use Images.xcassets as default for launch images located under Supporting Files.

Here are the images

Here is my Images.xcassets screenshot:

images.xcassets

The images are simply blank .png images with right resolution. As you can see in the last row, there is also the LaunchImage for iPhone 5. In my project general settings, Images.xcassets is set as Launch Images Source.

P.s. i know that this question was asked a lot of times, but also if i read the previous answers i couldn't find a solution.


Solution

  • Update March 2, 2015

    If you don't want to use a storyboard file, but want to just make your current assets work, it sounds like you're missing the reference in Info.plist. The issue is described here (with solution): "Your binary is not optimized for iPhone 5" after I upload an app with xcode 6.0.1. You can also view the Info.plist key list here: https://developer.apple.com/library/ios/documentation/General/Reference/InfoPlistKeyReference/Articles/iPhoneOSKeys.html#//apple_ref/doc/uid/TP40009252-SW24


    Using a LaunchScreen Storyboard file will eliminate this problem. There's a good tutorial here: http://oleb.net/blog/2014/08/replacing-launch-images-with-storyboards/.

    Basically, you have to create a blank storyboard file called LaunchScreen.storyboard. Then, in your target settings (the general tab), set your launch screen file.

    Add a view controller to the scene and position subviews in it to match your interface. Or, you can add the view controller and just leave it blank if you want.

    Xcode will prioritize your LaunchScreen file over any assets, so you don't have to delete them immediately if you don't want to.

    Next, build the project to test it. Archive. And try to submit again.