Launch Image does not show up in my iOS App
Asked Answered
M

28

149

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).

Middling answered 1/10, 2014 at 12:45 Comment(3)
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 .xibConstipation
@JuanBoero Why in the bundle? They're used at build time, not runtime.Endarch
Check this https://mcmap.net/q/111477/-launch-image-not-showing-up-in-ios-application-using-images-xcassetsLogic
C
239

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.

Adding all devices

enter image description here

Caz answered 2/10, 2014 at 8:17 Comment(13)
without the launch screen the keyboard size is different any idea how to fix that screencast.com/t/Vk18vuhSqZvNursery
"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.Seldun
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.Funkhouser
"Keep the "Launch screen file" blank." and Simulator "Reset Content and Settings" did the trick to me! ;)Intonate
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.Banwell
Ahhhh I needed to delete my app from the phone for changes to take affect, I just wasted a lot of time :'(Countess
@David Almost feel like that should be its own postYeasty
Where is this "Launch screen file" setting?Accolade
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.Abscission
This solution worked for me, but in only after I removed the app, cleaned the build folder and re-ran it. Thanks mate.Jodhpurs
I tried this, but it didn't work: #43168645 Any idea why? Thanks very much.Pitchblack
If you want to build for iPad keeping the launch screen file blank will get you rejected from the app storeBillie
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.Crissman
O
31

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

Overtask answered 28/11, 2014 at 4:42 Comment(3)
Good straightforward solution.Cede
"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.Stryker
This is old but this is what fixed it for me.Girdler
C
20

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.

Constipation answered 7/3, 2016 at 15:54 Comment(6)
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.Gestapo
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!Vedis
Thanks a lot, I spent nearly 3 hours debugging this issue. Turned out .xcasstes were to blameFrameup
Same here, changed the image file that was used in the xib from 1024x1024 to a less thane 512px resolution fixed it.Utopianism
@JuanBoero In the bundle? They're used at build time, not runtime.Endarch
Thank yo so much @Juan, i've trying lot of hours for thisExterminate
P
17

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

Persse answered 18/11, 2014 at 20:25 Comment(3)
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 choicePolyphagia
Adding the Launch Sceen.xib without using it anywere, actually did the trick for me. Thanks!Fondue
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...Stonybroke
P
12

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.

Pforzheim answered 16/6, 2016 at 14:27 Comment(1)
After uninstalling the app, I also had to restart the device. Additionally, I cleared the Xcode cache, and also restarted Xcode.Troyes
N
11

For the people who are using the Asset Catalog's Launch Image, as I learned this the hardest way, I had this scenario where I was first given a jpg file then I asked them convert it to PNG.

I trusted them enough that I scoured the internet first as to why the launch image wasn't showing and did every solution to no avail, then I tried putting back the old launch image and was working fine, it was there that I thought what I have is not a proper PNG file.

TL;DR: Make sure that you are actually using a proper PNG file, not a file with a renamed extension.

Natty answered 11/9, 2015 at 6:38 Comment(1)
careful with using uppercase in file extensions, while device will properly locate the file, simulator may not.Constipation
C
10

Removing "Launch screen interface file base name" from Info.plist file AND trashing "Launch Screen.xib" worked for me.

Cimino answered 8/1, 2015 at 14:12 Comment(1)
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.Decibel
F
7

Simply removing and reinstalling the app worked for me:

  • Testing in the Simulator

    1. Delete the app in the simulator.
    2. Quit and restart the simulator.
    3. Run the project again in Xcode.

  • Testing on Device

    1. Delete the app from the device.
    2. Run the project again in Xcode.
Formant answered 27/2, 2018 at 15:1 Comment(1)
For device, not only deleting and reinstalling did not work for me. Restarting phone (device) was the solution in my caseWassail
R
6

The problem with the accepted answer is that if you don't set the Launch Screen File, your application will be in upscaling mode on devices such as the iPhone 6 & 6+ => blurry rendering.

Below is what I did to have a complete working solution (I'm targeting iOS 7.1 & using Xcode 8) on every device (truly, I was getting crazy about this upscaling problem)

1. Prepare your .xcassets

To simplify it, I'm using a vector .PDF file. It is very convenient and avoid creating multiple images for each resolution (1x, 2x, 3x...). I also assume here you already created your xcassets.

  • Add your launch screen image (or vector file) to your project
  • Go to your .xcassets and create a New Image Set. In the Attributes window of the Image, select Scales -> Single Scale
  • Drag and drop the vector file in the Image Set.

Create an Image Set for your .xcassets

2. Create your Launch Screen file

Create a Launch Screen file

3. Add your image to your Launch Screen file

  • Add an Image View object to your Launch Screen file (delete the labels that were automatically created). This image view should refer to the previous .xcassets Image Set. You can refer it from the Name attribute. At this stage, you should correctly see your launch screen image in your image view.
  • Add constraints to this image view to keep aspect ratio depending on the screen resolution.

Add the splash screen image to your Launch Screen file

4. Add your Launch Screen file to your target

Fianlly, in your Target General properties, refer the Launch Screen file. Target Properties and Launch Screen

Start your app, and your splash screen should be displayed. Try also on iPhone6 & iPhone6+, and your application should be correctly displayed without any upscaling (the Launch Screen file aims to do this).

Remarkable answered 6/3, 2017 at 16:16 Comment(4)
I tried this, but it didn't work: #43168645 Any idea why? Thanks very much.Pitchblack
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.Honegger
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.Devon
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.Devon
J
5

After several hours frustrated on this, I decided to use this way. It works for both iPhone and iPad (on Xcode 6.1)

  1. File >> New File >> User Interface >> Launch Screen
  2. Create new key/value: "Launch screen interface file base name"/"Your Launch Screen Name" in YourApp-Info.plist

1 picture worths more than thousand words. Please look at below:

File>>New File>> User Interface >> Launch Screen

Create new key/value "Launch screen interface file base name"/"Your Launch Screen Name" in YourApp-Info.plist

Jim answered 27/10, 2014 at 15:21 Comment(0)
M
4

I've read about a bug in Xcode 6 which prevents landscape only apps from displaying a launch image.

Try to set images and orientation within Images.xcassets:

Xcode screenshot of Images.xcassets

Matland answered 1/10, 2014 at 13:18 Comment(2)
what exactly are you trying to tell with the screenshot ?Stiver
to check the orientation on the attribute inspector.Matland
C
2

Do what Spectravideo328 answered and:

Try to UNCHECK the iOS 7 and later box and CHECK the iOS 6 and prior box in the asset catalog. There seems to be a bug with the iOS 7 Launch Image. (These both have the same Launch Images except for the 320x480 one)

Hope this helps, it did help for me!

Compendious answered 23/11, 2014 at 16:15 Comment(0)
S
2

There is a bug where Xcode 6 launch images stored in asset files cause iphone landscape only apps on iOS7/iOS8 to display a black launch image. iPad works fine.

http://www.raywenderlich.com/forums/viewtopic.php?f=2&t=10868

Solution: Use the new Launchscreen.xib for ios8+ onwards. (it is far better)

For ios7 devices to work you simply turn off launch images source and use the old school launch images file names in the plist

iphone5 - [email protected] 
iphone4s - [email protected]
ipad2 - Default-Landscape~ipad.png
ipad retina - Default-Landscape@2x~ipad.png

Painful but works. B
enter image description here

Shupe answered 13/8, 2015 at 16:40 Comment(0)
M
2

I have tried everything but solution was extremely simple. Just use .jpg file instead of .png on your LaunchScreen.storyboard. It seems like iOS does not render .png file or relatively big image size at launch screen.

Malformation answered 1/2, 2018 at 16:41 Comment(1)
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!Forename
M
1

I set up "LaunchImage" in my asset catalog and simply cleared the "Launch Screen" field et voila ! I had the launch images appear ...

Muimuir answered 17/12, 2014 at 12:34 Comment(2)
You'll get legacy scale in your app with that option.Bifarious
@GeorgeMays How can you use Launch Images without getting legacy scale?Policlinic
C
1

One way is to also add "Launch Screen" (LaunchScreen.xib), paste the image into UIImageView and then set it to "Horizontal Center in Container" and "Vertical Center in Container" in "Align" if you are using Auto Layout.

Screen: https://i.stack.imgur.com/CfnHT.png

Don't forget to put LaunchScreen.xib into "Launch Screen File".

Catalonia answered 11/2, 2015 at 0:21 Comment(0)
M
1

I had the same issue after I started using Xcode 6.1 and changed my launcher images. I had all images in an Asset Catalog. I would get only a black screen instead of the expected static image. After trying so many things, I realised the problem was that the Asset Catalog had the Project 'Target Membership' ticked-off in its FileInspector view. Ticking it to ON did the magic and the image started to appear on App launch.

Myeshamyhre answered 12/9, 2015 at 12:58 Comment(0)
H
1
  • Make sure your images are accurate size according to Apple guidelines.
  • Make sure, You will select only one option , either launch screen file or Launch Image Source. You can find these two options in Project build settings -> General

My suggestion to you is to select Launch Image Source as Image.Assets. Create splash image assets there in Image.assests folder.

Reference image for right configuration: enter image description here

Hymenium answered 23/10, 2015 at 6:25 Comment(0)
J
1

If you have changed your launch image from a previous image, and observe the following:

  • devices/simulators where the app was previously installed, still show the previous image and refuse to show the new one (uninstalling and reinstalling the app doesn't help)
  • devices/simulators where the app was not previously installed, show the new launch image

It is likely because of the caching of launch image done by iOS. Rebooting the device should solve the problem.

Jessiajessica answered 15/3, 2019 at 14:31 Comment(0)
U
0

I tried opening a new project, and moving through the same steps you did to set a launch screen.

By default, the .xib was set as "Launch Screen File," and the white screen with a label did show for half a second in the simulator.

I then a "Launch Images Source" and set it to the Images.xcassets which generated with the background images I added to the project. (all good so far)

Rerun the simulator and the launch images don't show...

After deleting the specified "Launch Screen File" and a clean: Product -> Clean, from the top menu, the launch images finally show up.

Maybe that will help?

Udder answered 1/10, 2014 at 18:24 Comment(2)
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.Middling
I didn't try the second time when I commented. Now I see the same issue.Udder
L
0

I encountered this bug also with my landscape-only app. Following carlodurso's solution works:

  1. tick the "Landscape" box
  2. drag and drop the image to the place.
Lazarus answered 16/11, 2014 at 16:40 Comment(0)
C
0

There is a file 'LaunchScreen.xib' automatically added to your project Deleting this will shift xCode to using your Default images in Images.xcassets

edited to add go to App Icons and Launch Images Launch Screen File should be blank/emtpy

Constantina answered 30/11, 2014 at 21:8 Comment(0)
S
0

I had a very strange bug. Apparently my launch image source was only set for debug configuration and not release. This resulted in my launch screen appearing when running debug configuration, but when I changed to release I just got a black screen.

I fixed this when I changed my build configuration to release the Launch Image Source button appeared and I had to choose Use Asset Catalog again.

For those who are curious, this is what my project.pbxproj looked like.

...
...
...
XXXXXXXXXXXXXXXXXXXXXXXX /* Release */ = {
            isa = XCBuildConfiguration;
            buildSettings = {
                ALWAYS_SEARCH_USER_PATHS = NO;
                ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
                ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; <---THIS LINE WAS MISSING
...
...
...
Seltzer answered 12/6, 2015 at 22:0 Comment(0)
L
0

For some reason, I had to change the asset catalog location to "relative to project" for this to work.

I had also deleted the app from my phone and reinstalled, but it was probably the "relative to project" that did it.

Laparotomy answered 3/1, 2016 at 1:53 Comment(0)
M
0

* (Xcode 7.2 / Deployment Target 7.0 / Landscape Orientation Only) *

I know is an old question but with Xcode 7.2 I'm still getting the message and I fixed with this:

1) Select PORTRAIT and both landscapes. Add "Launch Images Source" and "Launch Screen File"

enter image description here

2) In your Launch Image select iPhone "8.0 and Later" and "7.0 and Later".

enter image description here

3) Add this code in your appDelegate:

#if __IPHONE_OS_VERSION_MAX_ALLOWED < 90000
- (NSUInteger)supportedInterfaceOrientations
{
    return UIInterfaceOrientationMaskLandscape;
}
#else
- (UIInterfaceOrientationMask)application:(UIApplication *)application     supportedInterfaceOrientationsForWindow:(UIWindow *)window
{
    return (UIInterfaceOrientationMaskLandscape);
}
#endif

4) Add this on your ViewController

#if __IPHONE_OS_VERSION_MAX_ALLOWED < 90000
- (NSUInteger)supportedInterfaceOrientations
#else
- (UIInterfaceOrientationMask)supportedInterfaceOrientations
#endif
{
     return UIInterfaceOrientationMaskLandscape;
}

I hope help to somebody else.

Misjoinder answered 6/1, 2016 at 18:10 Comment(2)
I tried something similar, but it didn't work: #43168645 Any idea why? Thanks very much.Pitchblack
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?Hereinto
C
0

This is worked for me. Click LaunchScreen.storyboard then in the right panel you can select "Is Initial View Controller" check box.

LaunchScreen.storyboard -> Is Initial View Controller

Conglomerate answered 1/12, 2016 at 10:53 Comment(0)
H
0

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. My Setup: I am using Swift 3.1 with Xcode 8.3.1. In LaunchScreen.storyboard I added a simple image view and stretched the image to fit the view controller. I set auto layout constraints Top/Bottom/Leading/Trailing space to superview to 0.

Honegger answered 24/4, 2017 at 16:16 Comment(0)
C
-2

For me, it works when I remove LaunchScreen.xib and change it to a storyboard file LaunchScreen.storyboard.

Coppice answered 6/1, 2016 at 21:46 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.