271

I'm trying to get an image to display as the launch screen from my Launch Screen.storyboard file, however the image never displays. I have labels that show up fine, but the image doesn't appear.

This is how the launch screen looks in the Launch Screen.storyboard file: enter image description here

However when I run the app on the simulator (as well as on the physical device) this is what shows up:

enter image description here

As you can see, the label "Test" shows up fine, however the image does not display. I'm really not sure why this is happening and nothing I try seems to work. If anyone has any ideas of how to fix this it would be greatly appreciated.

9
  • 1
    make sure that your image is in proper png format. not jpg if it is. Commented Apr 16, 2016 at 20:48
  • 7
    The fact that multiple, completely different answers have lots of upvotes is very, very sad. Commented Jul 20, 2018 at 6:39
  • 3
    Is it possible that if the image is too big and its load time take too much it is discarded from launch screen? Commented Sep 3, 2018 at 13:37
  • 3
    What solved it for me was just quitting the simulator and running the project again. Commented Jul 9, 2019 at 3:10
  • 6
    Huh! This issue still exists. Hard restarting the device solved it. Commented Mar 10, 2022 at 23:32

39 Answers 39

512

After restarting Xcode, cleaning the build and a number of the other suggestions on SO about this problem. What actually fixed it for me was a hard reboot of the device. (I wasted over an hour on this)

I suppose it just goes to show that the old saying have you turned it off and on again is still true for the latest gadgets!

How to reboot iPhone XS or iPhone XS Max

  1. Quickly press and release the Volume Up button
  2. Quickly press and release the Volume Down button
  3. Press and hold the Side Button until the Apple logo appears
Sign up to request clarification or add additional context in comments.

22 Comments

Had the issue of an image not updating after overwriting it in the assets. Thanks for the tip, completely quitting the simulator and restarting it updated the preview. Very odd that nothing else seemed to do the trick.
Thanks. It also works for the simulator. After restarting the simulator, the image in the Launch Scree.storyboard finally shows up. It's definitely a bug of iOS.
Same problem here. Even I got the image changed on the launchscreen in the simulator, the old image somehow was still cached on my phone. Tried clean build, change file name, change image, didn't work. I had to turn my phone off and on. That fixed it.
This is just beyond my comprehension that after eleven major releases of Xcode and thirteen major releases of iOS we have to deal with such preposterous issues...
2021 and this bug is still here. After wasting 3 hours on this issue this answer saved me.
|
145

I was messing around with this for hours too. But i found the solution now. You need to add the image to your project and also to the assets.xcassets via drag and drop.

14 Comments

This was it. Image had to be in both project and assets. This is like a game of whack-a-mole. Which tip will fix it? nobody knows.
Adding image just to the project fixed my issue :)
this is a pretty silly "bug" in xcode, Hours of stress and such a simple answer. This should be accepted
Thank you, this sorted it for me. To add to this, I had previously named the images with the size (launch280.png, launch560.png, launch840.png) and also added an asset to Assets.xcassets with asset name of launch. But it still didn't work. I had to rename the image files to launch.png, [email protected] and [email protected], add them to the project, add them as an asset called launch, and then it worked. Thanks Apple for making the simplest of things needlessly complex ¬_¬
Aaaand I'm here for the second time 3 years later... It's April 2020, XCode still has this bug... Nice...
|
67

Had the same issue, adding the image to the "Build Phases -> Copy Bundle Resources" fixed it for me.

2 Comments

This is what I needed. The image must be in the main bundle not in the assets file.
yep did it for me.
40

Follow below steps,

  1. Remove application from the device
  2. Restart device
  3. Build again

If not working, delete derived data. Xcode Preference->Locationtab->Derived data. Then do follow above steps.

Comments

30

It happened to me and makes me crazy, beyond get me lose some minutes 'til I figure it out.

So, like was said before:

  1. Import the desired image to your Xcode project (just drag and drop it)
  2. Change its Constraints and Alignment
  3. Update frames resolving Auto Layout issues
  4. In the Attributes inspector tab menu (generally in right corner menu xCode), on Image view > Image, remove image extension (.png or .jpg) - that's the trick

On the design screen, it will not appear, but when you run your app, it will be shown.

I hope it can help!

2 Comments

worked for me! before trying your solution the only way i got it to show was restarting my phone! Thank you
Yes indeed!! The trick is to remove the image extension from .png image files! .jpg files didn't work so i had to convert them to .png first! Thanks a lot Jhnosore!
29

Very frustrating. Solution that finally worked:

  1. Do hard reboot of device

  2. Delete app

  3. Install app from Xcode

Comments

28

At last, restart the phone works for me!!

I have spent hours on this issue. Had tried change the images name, delete the whole image assets, modify info.plist, restart Xcode and even tried to set all the attributes of the images(which you can tell how desperate I was).

6 Comments

This does not provide an answer to the question. Once you have sufficient reputation you will be able to comment on any post; instead, provide answers that don't require clarification from the asker. - From Review
Im sorry @AdamRichardson it provides an answer and a correct one too and this was my case. I just needed to just RESTART the phone/simulator.
I spent 16 hours trying to resolve this and finally restarting the phone made the trick.
I bet someone at Apple that could fix this must be thinking: "Oh, they just need to restart their phones - it's not like this affects Release builds or anything. We can leave this task for later."
Ultimately it ended up being reboot the phone that fixed the issue
|
20

After invested a lot of time, I got the solution:-

Step 1:- Quit Xcode
Step 2:- Delete the app from device/simulator
Step 3:- Restart your device (if you are using simulator then you have to quit simulator)
Step 4:- Clear all derived data 
Step 5:- Clear Bin
Step 6:- Open Xcode and relaunch the app, it will work 

Comments

19

I faced the same problem.

  1. Add an new imageset to XcodeAssets.
  2. Add images to to the imageset.
  3. Add image view to launch screen and set your imageset as image
  4. On Imageview's attributes inspector, uncheck 'clears graphics context'
  5. Clean the build folder and run again.

enter image description here

3 Comments

thank you, super duper thank you. i always came back to your comment. this driving me crazy. and your fix is working for me.
uncheck 'clears graphics context' helped me!
I had to delete the app and restart my phone in addition to these steps, but it worked. thanks man
16

This issue is related to the Assets.xcassets to fix it you must add the image as resource but not in the xcassets folder and then should work just fine

2 Comments

This is the only solution worked so far. Restarting xcode, clearing derived data, changing image name didn't work. I don't recommend restart device as a solution to anyone
this bug is as old as the creation of xcassets. I have filled it mentally on my folder "stuff apple will never solve".
9

In my case, resetting content and settings for simulator fixed the problem.

Comments

9

After trying everything on several StackOverflow threads, here's what worked for me:

  • Use a .png
  • Do not include it in your Assets catalog. Add it to your project's hierarchy directly, as you would add any source file.
  • In the image view, load the image including its extension. Example: launch_app_image.png

(Might have to clean product or derived data to update, but I didn't have to)

3 Comments

2020 and this is still relevant, sometimes changing the image to a new PNG inside the catalogue when it works will stop it. Unsure if it's a compression level thing but plain image files works.
Tried all the hints explained above - nothing worked but the .png file. Thx Kqtr!
Tried the others and this is the only one that worked for me. I even swapped to much larger files on the launch screen (jpg and png with/out transparency) and no problems. Removing it from assets and put it in the project and reference by file name was the winner. No idea why... Makes no sense. Ended up with the jpg. But a big thanks to everyone who made suggestions.
8

Importing images as regular files worked for me. Don't add image from assets catalog!

enter image description here

enter image description here

4 Comments

So I found this happening and I too think it has something to do with the @ images. I removed the @2 and @3 and bingo it now shows up!
After 8 hours of head-meets-brick-wall, I reimported the .png images as regular files (under Supporting Files). iOS was happy to display other jpegs, Apple SVGs and miscellaneous PNGs but not the client logo, regardless of filename, file format, size, colours, clean build + delete from device, restart Xcode, or any other solution above. Would love to know what I missed. (I've been working with iOS for more than ten years. Maybe just a bad day.)
@AndrewKingdom can't tell what could go wrong... try renaming it, resaving as jpeg (to test) and then maybe resizing/resaving it as a new PNG
Renaming it didn't work, re-export as a different size didn't work. Weirdest thing I've ever seen. I'm guessing it's either some very obscure bug in Xcode or some corruption of the project. Thanks for the suggestion though.
5

It seems there is some problem with resource caching in xCode. Had the same problem, restarted xCode and everything works fine after that.

1 Comment

Just had to disassemble my Mac, then assemble it again. Done same thing for the iPhone. Camera, everything. Works like a charm.
5

Restart your device and clear x-code derived data

Comments

5

Actually, for some heavyweight images, it isn't a good situation to add them into images.xcassets, because the app loads images.xcassets lightweight images before launch. So I put splash screen images at the first root of load and then the issue has gone:

  1. Create a new Group in the root of the project
  2. Drag and drop your image inside of the yellow group folder
  3. Rename it to a different special name
  4. Back to your xib (or storyboard) file and address the ImageView to the special name that it is in step 3.
  5. Clean and build again, then you can see your image.

Hint: You can create your ImageSet in the images.xcassets but place them in the root of the project.

Comments

4

Was changing the background image of the splash screen and the new image wasn't showing (react native project).

Following the answers from others.

I did all the below and it was fixed:

  • Clean build.
  • Remove app from simulator
  • Quit simulator
  • Restart XCode
  • Run app again

Comments

3

I had that problem after adding image to project and shotdown the device the problem solved

Comments

3

Well As of now there is retina device available and I ignored @1x image in Assets.xcassets.

In my case, I have app logo in Splash screen which is not visible when I run the application.

After wasting so much time I figured out that I only provided @2x and @3x images for that logo image.

This issue is resolved by adding @1x version of that image.

Comments

3

In my particular case, the splash screen worked for the simulator and other devices, but stopped working for one specific device. This lead me to believe that it was some caching data kept by xcode (v10 and iPhone 7 v12.1).

I deleted the derived data at: ~/Library/Developer/Xcode/DerivedData/ only emptying the folder contents, not deleting the folder. I then rebooted the mac and the iPhone and cleaned and rebuilt the project, and now it is showing up.

I'm not sure if all of this was necessary, but didn't want to waste any more time narrowing it down, so the above sledgehammer approach worked for me. But of course it always depends on your specific situation - mine was device specific; for others it could be the actual image or launch screen layout etc.

Comments

3

In my case, it was a bit more than just rebooting the device. My launch image was stored in other Assets (Other Pods).

Had to move the image to App project's Assets. And then rebooted my device. (Check simulator first, it should work). Then it worked.

Images can be in format png/pdf, single scale or not doesn't matter.

Comments

3

I was stucked into same issue thanks to the below reference I am able to resolve the issue

https://developer.apple.com/forums/thread/19759?answerId=75438022#75438022

Though it is not necessary to change the image name and removing the extension while selecting the image for imageview, I simply created one folder named resources and added my image inside that folder coz I thought it would be not good to put images directly into the root folder

Hope this would help.

Happy Debugging!

Comments

2

You have to make sure that the file name of your image has a format like .png or .jpg at the end otherwise it will not work. Also, before adding your image, you have to make sure that the image file is in your "Assets.xcassets" folder within your project. This can be done with a simple drag and drop. Also, make sure when you've added your image to your storyboard that the image name in the top left also matches the real image file name. I would try looking into Constraints too. Hope this helps. Good luck with your App.

Comments

2

I tried so many things with this (this thread alone seems to have a million ideas and half of them are conflicting). The problem for me was that when I did things like restarting the device and Xcode, it would cause the image to show for a few sessions of the app, and then it would stop (I have no idea why, but WOW it was annoying).

After countless hours, I found that A.G.'s answer in this thread is the correct one. The one thing I was doing wrong was that I was creating a new image set within xcassets, but I was then still using the name of the image within the UIImageView inside of the storyboard instead of using the name of the image set.

To clarify, what you would do is create a new image set and name it something like "Launch-Defaults", and then add your images to it. Then, within the UIImageView inside of the storyboard, you use the image "Launch-Default" (not including an extension since there is none since this is an image set).

When you do all of that, the image should actually appear correctly inside of your storyboard. Some people say the image will display blank if you don't use the extension (.jpg or .png), but I assume that is because they are not using the name of the image set. Others say you need to use an extension like .png or .jpg, but the key is to create the image set inside of xcassets and then use that image set inside of the storyboard. When done correctly, there should be no funkiness like an image not showing up or the Launch Screen only working some of the time (requiring a reboot).

Comments

2

Just to add my $0.02 to this question; I got this solved by using PNG images instead of JPG/JPEG images.

After converting the images to PNG and crunching them to reduce the size a little, everything worked fine.

Comments

2

My issue.

Reason: I have renamed the images after dragging into Xcode. Solution: Don't rename images after dragging into Xcode. It creates problems for understanding Xcode. Rename images before dragging/adding into Xcode.

Hope it helps you out!

Comments

2

There was 2 issues in my case that resolved it:

  1. It seems there is a 1MB size limit for the image; not documented but when I optimized the same image from 3MB to under 1MB it worked. This would make sense since the OS wants the launch screen to be light as possible.
  2. The OS does indeed cache the launch screen aggressively! To see my launch screen changes, I had to reset the simulator each time: Device > Erase All Content and Settings

Comments

1

I spent hours on this problem before finally realizing my mistake. When you add an image to a UIImageView, it will use just the name of the image. If your images are in a different folder than your storyboard, they will show up in xcode but not when running the app. You must add the appropriate file path prefix, for example, images/image.png. It will now appear as a blue question mark in xcode, but it will work in the app.

Comments

1

I faced the same issue. Tried different solutions for that but nothing proved to be helpful. I then realised that the image was not visible only when i directly installed the app into device and the app is still connected to the xcode. If i disconnect it and then open the app the image was visible as expected. It might be a xcode bug.

Comments

1

I tried cleaning the project, removing the png, removing the constraints did not work for me.

I just made one more copy of the image and renamed the copy then deleted the old image and added the new image (Same, with name changed) i just gave that image and it worked for me.

Also i am not using the Assets.xcassets, using the image in a folder.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.