54

I upgraded Xcode to version 12 and tested my app on iOS 14. Now the problem is, that my launch screen is just showing in black. I tested it with an iOS 13.5 device and it is still working as expected. I tried to remove the launchscreen.storyboard approach and added the Launch Screen key in the info.plist, but then the image is scaled to full size.

Now I tested a little bit with the launchscreen.storyboard and I found a few things.

  • If I remove the Image view, the launch screen is showing as expected. I added just a label and that would work.
  • If I use an image from the system in the image view, it is working as well. It is just not working when I am using an image from the project.

Did you experience issues with iOS 14 and the storyboard approach?

If yes, how did you fix it?

desertnaut
  • 57,590
  • 26
  • 140
  • 166
Sylber
  • 961
  • 1
  • 7
  • 15
  • 1
    had similar issue and renaming the image from LaunchImage.jpg to SplashImage.jpg solved the issue, at least for now – Shaz Sep 21 '20 at 05:15
  • 1
    We're facing the same issue. But it also happens to our builds with the iOS 13 SDK on iOS 14. – förschter Sep 21 '20 at 14:21

22 Answers22

43

A work around that seems to be working for me:

For a strange reason if I am downsizing the image then it is working fine. I had a full size image of dimension 2732x2732 and it didn't work. Reducing the dimension of the same image to 2400x2400 is working fine. I have tried with 2500x2500 and 2600x2600 but none worked.

Most importantly, every time I change the image I had to restart the simulator to reflect the updated image.

It didn't work on the real device yet. Like the simulator, I had to restart the device and then only it worked.

Not sure if it is something with the dimension/size of the image or with the reboot.

Further updates:

I uploaded the same build (with smaller image) to TestFlight and installed it on my device (basically updated from the previous version having large size image) and unfortunately the issue persisted :(

Now what I did is uninstalled the app and reinstalled it again from TestFlight. Issue still persisted.

Finally I had to delete the app, reboot my device and install the app again. This is when it worked fine.

Saddam Akhtar
  • 446
  • 1
  • 3
  • 5
23

So here are a lot of good ideas, but I was able to finally solve the issue - it is more like a workaround. I needed to store the picture outside the Images.xcassets folder and then it started to work again. This is a very weird issue.

Sylber
  • 961
  • 1
  • 7
  • 15
19

A workaround is to use a button with an image instead of an imageview in the launch storyboard. It works like a charm!!

Tomer Shetah
  • 8,413
  • 7
  • 27
  • 35
RayanAlsobbahi
  • 199
  • 2
  • 3
12

One reason might be the size of the images. Since iOS 14 images for launch screen are limited to 25 MB as stated in Apples Human Interface Guidelines.

An image with 2.400x2.400 pixel will result in a memory size about 22 MB. With 2.500x2.500 we reach the 25 MB.

We had the same problem where the full screen image in LaunchScreen.storyboard was black on all @3x devices like iPhone 12. Reducing the size of only the @3x launch image from 3.072x3.072 to 2.400x2.400 solved this problem.

A square image is the easy way to support landscape and portrait orientation. But it should also work to have different images for each orientation, where one image in total is less than 25 MB.

Thorsten Stark
  • 121
  • 1
  • 5
  • There is definitely a bug where in iOS 14 it will stretch your bitmap to fit. I don't see a way to make this work. – RopeySim Jan 26 '21 at 14:01
  • This solution is meant for use with LaunchScreen.storyboards where you use an UIImageView to display the image. There you can specify the scaling behavior. But good hint, I will add this to the post. – Thorsten Stark Jan 27 '21 at 15:04
  • From apple's documentation **Don’t use a static image for your launch screen. In iOS 14 and later, the launch screen is limited to 25 MB.**: https://developer.apple.com/documentation/uikit/app_and_environment/responding_to_the_launch_of_your_app – ZYiOS Sep 30 '22 at 00:48
  • I was using a .png image which was only a fraction of this size, but still had the problem (Xcode 14.3). My guess is that the image is converted to a bitmap for presentation. An image which was 3200x2000 was too big, 3000x1875 works. So it would seem that 5,625,000 pixels <= limit < 6,400,000 pixels. – Benzy Neez May 25 '23 at 20:18
7

Had the same problem. The issue was the .png image used in the launch screen storyboard. This lead to the whole launch screen just being black.

What fixed it in our case was:

  • Choose a smaller image
  • Delete App from device/simulator
  • Restart device/simulator

I found that the image was the source of error by replacing the image with an other one in our app. It immediately worked with a different image (no restarting or else required).

themenace
  • 2,601
  • 2
  • 20
  • 33
5

The only workaround that works for me was to add the images outside Images.xcassets folder. After modified this and rebuild the app, it worked expected.

Some issue it's happening on the iOS 14 or XCode 12.

4

I encountered this problem

when using LaunchScreen.storyboard and used the image on Assets.xcassets, not working on iOS 14 with Xcode 12.

I solved it by try put change 3x image 2436×1125,and set 2x image 828×1792.

Finally I had to delete the app, reboot my device and install the app again. This is when it worked fine.

qing shao
  • 41
  • 3
  • 2
    Some advice as this is your first post. 1) Make sure your answer looks like an answer. Starting with a phrase like "I'm having the same problem" doesn't sound like an answer. Try to be more assertive, e.g. "I encountered this problem when... I solved it by..." 2) Don't add to your answer in comments. [edit] your answer instead. – David Buck Nov 12 '20 at 09:31
  • @DavidBuck It's very helpful to me. Thank you very much. – qing shao Nov 13 '20 at 02:44
  • looks like only iPhone reboot helped to me,. – djdance Jun 21 '21 at 13:34
3

I had this, too. Pretty infuriating. My launch screen is merely a background image (2048x2048 PNG) and a graphic (2048x2048 PNG) in the middle.

The fix for me was to have a smaller middle graphic (720x720 PNG), remove the images from any assets catalogs, and add them into the project.

The images didn't show on the Simulator until I restarted it. When built and installed to my iPhone, I didn't have to restart it.

Darkpaw
  • 31
  • 4
  • The simulator (Xcode 12.3) seems to need to be restarted to notice a different launch background color or image. Closing the simulator device window is good enough. – Mark Knopper Jan 01 '21 at 21:27
3

In my case, the ViewController property, "Is Initial View Controller" was not checked. Also, be sure to set the color of the view to an actual color and not a system color, otherwise you can run into issues with the device theme settings. That is, if you like to show a specific color.

Also, to access that setting make sure you click on the actual View Controller object in the drop down panel. XcodeImage

Tiny
  • 401
  • 3
  • 8
2

In my case following did the job:-

  1. Remove Launch screen file from Project -> General -> App Icons and Launch Imagees -> Launch screen file.

  2. Go to info.plist file and open as source code.

  3. Add following code there and change the image name:-

    <key>UILaunchScreen</key> <dict> <key>UIImageName</key> <string>splash(This is your image name)</string> </dict>

  4. In iOS 14 this new key was released (UILaunchScreen). So take care from next time. If you get error then check info.plist file.

  5. Happy coding :)

dinesh sharma
  • 577
  • 10
  • 20
  • 1
    Unfortunately this doesn't work well. The image is stretched, and there's no way to specify an alternative representation – RopeySim Nov 05 '20 at 12:04
2

The only thing that worked for me was:

  1. Delete the existing LaunchScreen.storyboard & create a new one
  2. Check " Use as Launch Screen "

Use as Launch Screen

  1. Check " Is Initial View Controller "

Initial View Controller

  1. Make sure the image your using is NOT located under Assets.xcassets folder. I put my image in the root of the project
  2. Delete the app, restart the simulator, and run the application

BINGO!!!

Mario Bouchedid
  • 431
  • 5
  • 7
  • Thanks - Just wanted to add that "Is Initial View Controller" is also checked off on the View Controller you want loaded right after the Launch Screen. – heLL0 May 04 '22 at 16:19
1

So I've had this bugged with Apple via their feedback system since June 26th 2020 - FB7795777.

I've provided my project and many diagnostic reports and they've never come back with a fix.

However, today, I fixed it.

Basically, there has been some change in the iOS/iPadOS SDK about how it's support .PNG and .JPG files (size or dimensions are the problems I think) in the Launch screen process.

The solution:

Open your .PNG file in Photoshop and re-export it with the 'Smaller File - 8-bit' option checked. It shrunk it down to less than half the size, and it worked first time.

iOSProgrammingIsFun
  • 1,418
  • 1
  • 15
  • 32
1

That worked for me was:

  1. Put xxx.pdf image into Assets.xcassets and set "scale" to Single Scale

  2. In Launch Screen.storyboard, set the imageView's image is xxx, then set imageView's width, height, centerX and Bottom to View

Then worked for me

Xcode 12.5.1, iPhone 7 Plus, iOS 14.6

aheze
  • 24,434
  • 8
  • 68
  • 125
Shenry
  • 11
  • 1
1

In my own case , I solved the problem in these few steps:

  1. Image must be 1024px, then
  2. Add to assets

-> A workaround in case you have a much bigger image, use these simple steps:

  1. Generate your app icon
  2. Go to the app icon folder
  3. Copy the 1024 px of that image andappicon image
  4. Then add to assets. Both methods works perfectly.
Mary Jones
  • 99
  • 3
0

I use Cordova for my hybrid app, and then I load my image assets that are generated by Asset Catalog Creator (which is a great little product).

This was working perfectly until I updated to Xcode 12 and tried to run it under iOS 14.

What I discovered is that Cordova was adding a "CDVLaunchScreen.storyboard", and they had a "LaunchStoryboard.imageset" (directory) in their asset catalog, which contained just a contents.json file.

I simply copied this into my asset catalog, and when I drag and drop this into my updated project (newly generated each time by Cordova), my Launch Image displays again.

Don't ask my how or why Xcode magically wires this stuff together, but it worked for me.

I can pass along the contents.json that worked with my asset catalog if it will help.

BTW, my General settings screen does NOT have a Launch Screen File selected, but Xcode seems to find the required files.

desertnaut
  • 57,590
  • 26
  • 140
  • 166
JohnL
  • 21
  • 2
0

I've got yet another potential solution to this, as none of the existing solutions worked for me.

I use PDF vectors in my Asset file, and this normally works great. But it turns out that it doesn't work on the launch screen - it just shows skips the launch screen entirely if it contains a PDF image.

Swapped it for a large PNG, problem solved.

Colin Nicholson
  • 1,331
  • 12
  • 18
0

What worked for me:

  • Use smaller images like @Darkpaw suggested. Launch storyboards are, after all, intended to be indicative of the coming UI, not artwork based.
  • Use PNG image (not PDF) and don't put it in an assets catalog like suggested by @Sylber

Just noting separately as I had black/broken launch mages until I did BOTH steps.

Sparklellama
  • 712
  • 1
  • 6
  • 18
0

You might be seeing this issue if your @1x, @2x, @3x images are blank in your image xcassets folder.

Make sure you have images for each.

You can also select your 1 image, and set Scales as "Single Scale" in the Attributes inspector (on the right hand side)

Alan Scarpa
  • 3,352
  • 4
  • 26
  • 48
0

In Xcode 13 launch screen was not displaying rather a black screen was coming.

But this worked for me Project -> General -> App Icons and Launch Images -> Launch screen file -> change Main to Launchscreen.

0

Most answers mentioned here are workarounds, the issue i noticed is that when you modify the launch screen assets, do check the item file name too.

Assets -> Show in folder

enter image description here

Then check the launchscreen items folder and make sure that the item inside the folder has the same name as folder.

enter image description here

Vivek
  • 72
  • 1
  • 9
0

To expand on Thorsten Stark's answer above...

Since iOS 14 images for launch screen are limited to 25 MB

For me it appeared to be an accumulated size of assets on my Launch Screen storyboard file. When I removed a number of them I no longer saw the black screen.

I ended up just using one image 2778 x 1284 which was 600kb in size. This solved the problem.

To further test, I duplicated the image to make 3 copies on my Launch Screen storyboard file, and sure enough, black screen again.

Jared
  • 793
  • 6
  • 16
0

The best solution to me in 2022...

reduce sizes of your images, in my case: splash.png (256x256) splash@x2.png (512x512) splash@x3.png (768x768)

only doing this and put them in Resources folder then reference in ImageView work like charm....

alternative: use Button in place of ImageView works too

  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Vikram Parimi Sep 18 '22 at 16:55