Launch Storyboard not showing image when project builds to device.

I setup a Launch Screen Storyboard which has a logo for my app in .pdf vector. When I build the project image is not visible on device. Simulator works just fine. Tried on a few diffrent devices and the issue persists. Cleaned the whole project, deleted derived data, still an issue.


Image is getting pulled from Asset catalogue. Any ideas?

Same here, UIImageView only appears on Simulator !!


It seems to be definitely a bug, if you add Size Class Customization then remove them, the UIImageView appears again on device.

Hi,


I can confirm that this also happens to my project.


Details :

I use a LaunchScreen.xib file that has a couple of images and the Logo image centered. If ran on a device, the Logo image's not loaded, all other images are loaded. If ran on the Simulator, it works properly. I even tried putting the image to a different UIImageView element in the app and the image renders without issues.


Device :
iOS 9

iPhone 6


Additional fixes attempted

Replacing the image with a new logo

Issue persists.

Putting in another random image as the logo

The image renders fine (but there are other random images that do not render)


Hopefully we can get an answer about this since it completely blocks a release on the App Store.


Kind regards,

D6mi

I don't know if this will help anyone. I was having the same problem. I had several images on my launch screen that stopped showing up.


I did three things (the first two on their own didn't do it, but may have assisted the third which did work)


1) Copied all of the images to the root directory (same location as xcode puts the images)

2) Created a folder in Images.xcassets and put the images in there.

3) The images in the launchScreen.xib were originally called imageName.png. This was changed to just imageName (remove the file extension.


After the third thing the images appeared. I don't know if either of the first two steps are required, but hopefully it will help someone.

I had been experiencing similar issues for several hours. Then I thought about simply restarting the iPhone. Problem solved. 🙂

There has to be some caching related problem.

I also find this issue. It's XCode 7.0.1 bug,I also fix it without use images.xcassets.

The image can't show launchScreen.xib from images.xcassets.

1.you can copy the image to xcode project root path.

2.you must rename the image with the different name.

Wait so long and nothing change !


xcode **** 😠

A solution that worked for me: edit the image (with GIMP for example) and remove alpha channel from it.

Thank you. @buck. I just copied Image to xcode project root path. It was working fine now.

I was just having the same problem on my iPhone 6s running iOS 9.1 with an app I'm working on.


The solution for me was simply to make sure that the "Clears Graphics Context" box is unchecked for the UIImageView in the storyboard. Just changing this fixed it for me - I actually had another image in that same storyboard that had that box unchecked and it was already showing up.

I noticed the same problem sometime after upgrading to iOS 9.2 on my iPhone 6 and XCode 7.2. Your solution worked for me.

Yep, this seems to be a bug. Had the same problem, and i solved it by just rebooting both the iPhone and the Mac

Rebooting iPhone fixed for me too. Been struggling for hours on this... thanks

A StackOverflow answer by @jaga provides the solution, but not the reason, as to why UIImageViews are missing in the Launch Screen on device (but not in the simulator).


Background


Recently I attempted to use a custom font in my "Launch Screen.storyboard" file.


The reason I could not became clear after reading this StackOverflow answer by @TimCamber, which prompted me to do a little more research and testing.


The reason that a custom font is not included in my Launch Screen Storyboard file is the same reason an image within an asset catalogue is not included...


The app prepares portrait & landscape snapshots of the app's Launch Screen from your Launch Screen Storyboard file and (currently) saves it in your app bundle:


  • here /Library/Caches/Snapshots/<<app_bundle>>/;
  • and here /Library/Caches/Snapshots/<<app_bundle>>/downscaled/.


This process to prepare the launch screen is complete before any supporting files are loaded, including any custom fonts and the asset catalogue.


Solution


As mentioned above by following @jaga's solution, literally all that is required is to:


  1. (old school) add an image file (.PNG) to your app's bundle; and
  2. reference that image in your UIImageView object in the Launch Screen Storyboard file.

Example 1: Screenshot of Project Navigator in Xcode - image file added under the Supporting Files subdirectory in an Images subdirectory.


Example 2: Screenshot of Attributes Inspector in Xcode - Image View section detailing reference to the image file used for a UIImageView.

Thanks man, I didn't think about that, but indeed it fixed the issue!

Sadly, this still doesn't fix the problem. I had hoped this might be the issue because I do use a custom font on my launch screen, but the proposed solution did not work. The only thing that works is changing the name image file in the LaunchScreen.storyboard file from myLaunchImage.png to myLaunchImage. When I do this, the launch image shows up again. But as soon as I make a modification to the Main.storyboard, the launch screen goes black again. When that happens, I go back to my LaunchScreen.storyboard file and then change the image name again. This time I switch it back to myLaunchImage.png. This is maddening. Why would removing the image file extension (or re-adding it) temporarily fix it? And why is a modification of Main.storyboard impacting the display of the launch image.

I've been fighting this exact issue for a couple of days and taking the images used by my launch storyboard out of the asset catalog and making them simple files fixed the issue. It appears that asset catalogs are not reliably loaded in time to be used by launch storyboards.

I'm working with iOS 9. I crafted a Launch storyboard file and it worked. Then I changed some other stuff, and it stopped working. My app would start with a black screen. After much reverting with GIT and searching the internet, I discovered my problem:


One of the things I had done was rename an image used in the launch storyboard. "Gradient.png" became "Splash Gradient.png". I took the space out and it worked again!


It seems that if your launch storyboard has a UIImageView with an image whose filename contains a space, the entire storyboard won't launch. Same is true for a launch XIB (which I tried).

@jeffb6688 custom fonts and the asset catalogue are not loaded into memory by iOS in time for the app to display these in the launch screen storyboard.


This is why iOS prepares cached snapshots of the launch screen. The cached snapshots are used at launch, not the supporting assets.


The workaround for images is as I described in my answer (in response to question by OP).


The workaround for custom fonts is more complicated.


Regardless of where they are placed in the file system, custom fonts are not loaded into memory by iOS in time for the app to display these in a launch screen storyboard.


So the workaround... we must prepare static image files that contain the custom font as a part of (embedded into) that image, in a size and layout to suit each screen orientation, size and resolution.


It won't take long to realise that this can become a significantly time consuming exercise given the great number of possibilities for screen orientation, size and resolution.


We could complain about this but Apple makes it clear in their iOS Human Interface Guidelines that launch screen images are not intended to be traditional "splash screens".


In their words...


  • Design a launch screen that’s nearly identical to the first screen of your app.
  • Avoid including text on your launch screen.
  • Downplay launch.


Yes, Apple still approves apps with traditional splash screens, however this is contrary to their iOS HIG.

Restarting iPhone solved my problem too😎. Plus re-installing the app.

Xcode 8.3.2

Has still similar problems.

I changed existing image with new one on launch screen (by drag drop 3 images 1x 2x 3x recpectfully)

First, previous image shown long time. To get rid of it I deleted UIImage on launch screen re created a new one. Link with the name image; result : no image at all. This is not about alpha channel , I tested.

To resolve after many try, only thing which worked for me;

Creating; New image name (I mean newlogo.png) and new asset in Xcode with different name.

Then using it made work. I could see the new correct image.

Yup, dropping the asset catalog and putting the PNG file in the project tree did it

Additionally, I had to rename it (as I was trying to update an old version of it), or the old one would still show up until the device was restarted and the app reinstalled.

I know this post is old, but maybe this will help...


I had the same problem, but found out that it depended on where I put the image. The "Main" and "Launch" Storyboards were looking for an image in one Assets folder, while the app was looking for images in another.


I put the images into the correct folder, and the problem was instantly solved!

The answer was re-booting.

****, my hours..

I had the similar issue since using Xcode12.beta with Xamarin and for simulator and device (iOS13 and iOS14 devices)
My LaunchScreen has a background & text label plus a centered png image; was all working until changing to xcode12.beta.

Tried all solutions like renaming / creating new assets or using png bundle resource only... always just showing full black screen when launching. Also tried all reboot / uninstall / clean solution multiple times.
When editing the storyboard file to an invalid image name, the launchscreen will show (colored background & text), just without the image. When using the correct image (as also showing correctly in Xcode storyboard editor), the launchscreen only shows full black screen.

After changing back the underlying Xcode version in VisualStudio/Xamarin to Xcode11, the launchscreen immediately showed correctly again as before!

Has been facing the same issue on Xcode 12.2 beta. Lost lot of hours.
Just reboot your iPhone.
Launch Storyboard not showing image when project builds to device.
 
 
Q