Launch Image does not show up in my iOS App

125,496

Solution 1

So this has been quite painful for something that should be trivial. Here is what I did:

Use xcassets

I decided to use .xcassets versus the .xib for launch. I deleted the .xib. If you have images.xcassets already in your project then great, otherwise you can add one from File>New>file:

AddNewASsetCatalog

Create a Launch Image Set

Now create at a minimum a launchimage set and icon set in your .xcassets file by right clicking in the navigator area.

Add new Launch image and app icon

Update the App Icons and Launch Images Settings

Then I made sure that the "Apps icon and image sets" in my target are as below.

Very Important: Make sure the "Launch screen file" setting is blank.

Apps icon and image sets

Add the Images

Last but not least, the terminology used by Apple for the device selection is confusing. Initially I thought that since I am deploying for iOS8 only (iPhone Portrait), I can do this and just put in the iPhone 6 and iPhone 6+ launch images:

Devices

I quickly realized that is not the way this works and I was getting a warning: "An iPhone Retina (4-inch) launch image for iOS 7.0 and later is required."

So I had to select the iPhone under iOS 7.0 and later as well and add an Image for the iPhone 5s.

So to find out which boxes to check on the right, do not ask the question: What is my minimum iOS and device and device orientation but rather ask:

What devices out there can support my minimum iOS? Now What is the minimum iOS supported on those devices? And make sure you check all of those boxes. So for me, I am targeting iPhone 5s, 6 and 6 Plus at 8.0 but given that iPhone 5s can exist with 7.0, I need to check the 7.0 box as well to show the image placeholder. In other words, the (iOS) check box on the right shows you the minimum iOS version available for that device and you need to click it to show the image placeholder and put an image regardless of whether you are deploying at this iOS version or not.

Hope this helps somebody.

Adding all devices

enter image description here

Solution 2

The LaunchScreen.xib and the info value Launch screen interface file base name are from my experience both placeholders that are created when the project is created. If you would like to use the Images.xcassets exclusively for your launch screens, delete both the LaunchScreen.xib and the info.plist item.

If you provide the info.plist setting you app will use the xib and not your Images.xcassets

Solution 3

Xcode 8:

Images used in LaunchScreen.xib should not be on a .xcassets, try dropping them in the bundle.

Looks like that by the time that the .xib gets loaded, the images in the .xcassets are not yet available.

EDIT: For some opaque reason after adding some localizations, launch screen stopped working, now it works with an image from the assets, extremely weird.

Solution 4

My solution was to create all the launch images. enter image description here

Then I set the Launch Images Source to the LaunchImage asset, and leave launch screen file blank.

Finally if the project does not have a Launch Screen.xib, then add that file and leave it as is. enter image description here

Solution 5

For me, it worked when I uninstalled the app and then restarted the simulator. When installed again, launch image appeared as expected. This also worked on an actual device.

Share:
125,496

Related videos on Youtube

Eddie Hartman
Author by

Eddie Hartman

Updated on July 31, 2020

Comments

  • Eddie Hartman
    Eddie Hartman almost 4 years

    I want to get a simple launch screen to show in my app, built using Xcode 6.0.1.

    I have added a launch screen in two ways: As an XIB (with the default name, LaunchScreen.xib) and as a launchimage set within xcassets.

    I have made sure that my "Launch Screen File" is set to LaunchScreen.xib.

    I have simulated every device available (e.g., "iPhone5 iOS8" / "iPhone5s iOS8" / "iPhone6 iOS8". Note that only iOS 8 is available within the simulator).

    • Juan Boero
      Juan Boero over 8 years
      Images used in the launch screen should not be in Images.xcassets, they should be put in the bundle, to check that try with a test image that is not in the xcassets, and setting another background color to the .xib itself, to see if it is loading the .xib
    • Rudolf Adamkovič
      Rudolf Adamkovič almost 7 years
      @JuanBoero Why in the bundle? They're used at build time, not runtime.
    • Nike Kov
      Nike Kov about 6 years
  • Eddie Hartman
    Eddie Hartman over 9 years
    Terrence - did you try running the simulator again? The reason I ask is that this technique works the FIRST time I run. But on re-running the simulator, I am back to square one.
  • Terrence Giggy
    Terrence Giggy over 9 years
    I didn't try the second time when I commented. Now I see the same issue.
  • NikkyD
    NikkyD over 9 years
    what exactly are you trying to tell with the screenshot ?
  • carlodurso
    carlodurso over 9 years
    to check the orientation on the attribute inspector.
  • George Maisuradze
    George Maisuradze over 9 years
    You'll get legacy scale in your app with that option.
  • souvickcse
    souvickcse over 9 years
    without the launch screen the keyboard size is different any idea how to fix that screencast.com/t/Vk18vuhSqZv
  • Jasmeet
    Jasmeet over 9 years
    adding so many IMages. increases the ipa size. XIB Launch is the Solution for that. for example if u have plain Background and simply a logo in the middle, then its recommended we use XIB. Just set the Background color and add a UIImage in the middle, Thats it. But again its a choice
  • Travis M.
    Travis M. over 9 years
    Good straightforward solution.
  • Jose Manuel Abarca Rodríguez
    Jose Manuel Abarca Rodríguez over 9 years
    "arcady bob" solution worked for me : I opened "info.plist" and deleted the element "Launch screen interface file base name", ran my app and the launch image was finally there.
  • Jacco
    Jacco over 9 years
    Adding the Launch Sceen.xib without using it anywere, actually did the trick for me. Thanks!
  • sunny
    sunny about 9 years
    Xcode 6 will not let me change the "launch image source" but is keeping it with this text, which I am not allowed to modify: "Use Asset Catalog" - and it's behaving more like a button, where if I click on it I get the option to :Migrate launch images to an asset catalog...don't know where to go from here. Anyone else run into this? I have already imported an entire folder of premade launch images in different sizes into the LaunchImage asset catalog. No error messages, but I don't see my launch image or my app image even after following instructions above, rebuilding, restarting my computer...
  • TypingPanda
    TypingPanda about 9 years
    This solved my issue. But I think apple is suggesting that it would be better for others to using the xib file rather than generating 9 different images.
  • Crashalot
    Crashalot about 9 years
    @GeorgeMays How can you use Launch Images without getting legacy scale?
  • ReduxDJ
    ReduxDJ almost 9 years
    This stuff is so annoying.
  • Martin
    Martin almost 9 years
    This is old but this is what fixed it for me.
  • Mikrasya
    Mikrasya almost 9 years
    "In other words, the (iOS) check box on the right shows you the minimum iOS version available for that device and you need to click it to show the image placeholder and put an image regardless of whether you are deploying at this iOS version or not." --> this is the key here. thanks.
  • OhadM
    OhadM almost 9 years
    You sir, have won the internet.
  • Francis Jervis
    Francis Jervis almost 9 years
    This worked but the changes were only visible when the app was deleted from the device and re-installed. The old launch screen appeared to persist even after cleaning caches and deleting derived data.
  • C4 - Travis
    C4 - Travis over 8 years
    Such a b.s process. Thanks for posting this.
  • SDW
    SDW over 8 years
    "Keep the "Launch screen file" blank." and Simulator "Reset Content and Settings" did the trick to me! ;)
  • Nazir
    Nazir over 8 years
    If you where using different way, and then switched to launch image set and nothing changes - do not forget to clean project. This also could be reason when you did all correct but not working.
  • Phil Hudson
    Phil Hudson over 8 years
    Ahhhh I needed to delete my app from the phone for changes to take affect, I just wasted a lot of time :'(
  • DardanM
    DardanM about 8 years
    @David Almost feel like that should be its own post
  • andrewbuilder
    andrewbuilder about 8 years
    To add to your answer... Recently I attempted to use a custom font in my "Launch Screen.storyboard" file. The reason I could not became clear after reading this SO answer and a little more research / testing. It is the same for an image... Xcode prepares portrait & landscape snapshots of your app's launch screen and (currently) saves here: /Library/Caches/Snapshots/<<app_bundle>>/, completed before supporting files are loaded, including custom fonts and the asset catalogue.
  • auco
    auco about 8 years
    I noticed that larger images (>512px) didn't show up on my LaunchScreen when loaded from an .xcasset, whereas smaller images would show. Thanks for mentioning your solution!
  • Jack Robson
    Jack Robson almost 8 years
    Where is this "Launch screen file" setting?
  • darksinge
    darksinge almost 8 years
    Been searching everywhere for an answer to this! Like others mentioned, important to delete app and reinstall for changes to take effect. I sure hope this isn't as painful in Xcode 8.
  • asiby
    asiby over 7 years
    This solution worked for me, but in only after I removed the app, cleaned the build folder and re-ran it. Thanks mate.
  • Juan Boero
    Juan Boero over 7 years
    careful with using uppercase in file extensions, while device will properly locate the file, simulator may not.
  • Kartick Vaddadi
    Kartick Vaddadi about 7 years
    I tried this, but it didn't work: stackoverflow.com/questions/43168145/… Any idea why? Thanks very much.
  • Kartick Vaddadi
    Kartick Vaddadi about 7 years
    I tried this, but it didn't work: stackoverflow.com/questions/43168145/… Any idea why? Thanks very much.
  • Kartick Vaddadi
    Kartick Vaddadi about 7 years
    I tried something similar, but it didn't work: stackoverflow.com/questions/43168145/… Any idea why? Thanks very much.
  • Brian Bird
    Brian Bird about 7 years
    I just figured this out. My launch image was not showing up, I get a white screen when launching on a device (iPhone 6, 7+) or testFlight. Fix: Renamed "Landing_screen.png" to just "Landing_screen" removing .png part. The image icon in Xcode changed to white icon and in the launch screen storyboard the image appears as a question mark now. The Launch image now appears and not the white screen.
  • Sergey Grischyov
    Sergey Grischyov about 7 years
    Thanks a lot, I spent nearly 3 hours debugging this issue. Turned out .xcasstes were to blame
  • Adi
    Adi about 7 years
    I have a similar problem. When using vector graphics (pdf) the image is not showing in Lunch Screen, but if I use the same storyboard as Main (which is showed after the Lunch Screen), I can see the image. So, my guess is that vector graphics are not preferred as lunch screen.
  • Adi
    Adi about 7 years
    I managed to have this working by restarting the simulator. Previously I deleted the app and cleaned the project, but the splash image was still not showing.
  • Eike
    Eike about 7 years
    Same here, changed the image file that was used in the xib from 1024x1024 to a less thane 512px resolution fixed it.
  • drew..
    drew.. about 7 years
    This has got to be one of the more annoying little FU's in Xcode development. There are so few things (apparently) to set, and yet every project I create this one little beast takes up waaaay too much time. Each time i solve it, it seems random, and once it is working, i PRAY i don't accidentally touch that file/process again. New project, same crazy need to figure out why a simply graphic in the middle of the launch screen.storyboard is not showing. All settings are per requirements, but perhaps the moon-phase is wrong?
  • Rudolf Adamkovič
    Rudolf Adamkovič almost 7 years
    @JuanBoero In the bundle? They're used at build time, not runtime.
  • Subramani
    Subramani almost 7 years
    Thank yo so much @Juan, i've trying lot of hours for this
  • Andy
    Andy almost 7 years
    If you want to build for iPad keeping the launch screen file blank will get you rejected from the app store
  • tiritea
    tiritea over 6 years
    I had a png in my launch screen - which displayed perfectly fine when creating the storyboard in Xcode - but would just show up as black when actually tried to run the app on a real device. After pulling my hair out for a while, I replaced with jpg and now works fine. Thanks!
  • Kutay Demireren
    Kutay Demireren about 6 years
    For device, not only deleting and reinstalling did not work for me. Restarting phone (device) was the solution in my case
  • lenooh
    lenooh over 5 years
    After uninstalling the app, I also had to restart the device. Additionally, I cleared the Xcode cache, and also restarted Xcode.
  • Jim Hillhouse
    Jim Hillhouse about 5 years
    I banged my head dealing with this bug for...well, hours. Thank you for parting the cloud. One difference I would add would be to make absolutely sure that under iOS versions you deselect ANY platform for which you do not have images. This, and leaving BLANK the Launch Screen File entry, did the trick for me. Just my 2¢ worth. Again, thank you for taking the trouble to not only trouble-shoot this but to document it so well here.