Launch images show black, when using Asset Catalog
Asked Answered
S

9

19

In Xcode 5, I use the asset catalog to manage the app icons and launch images for my app. The app icons work fine on all devices, but the launch images just on a few.

I have added launch images for every possible device, and iOS (6.1 and 7.0), that I want to target. I have made sure that all images have the correct sizes, which is confirmed in the attributes inspector (see picture below) where the size of the images match the expected sizes. I have also named all images after the naming conventions, which should not even be necessary with asset catalog (see last picture). There does not seem to be any naming conventions for iOS7 launch images running on iPhone, so I have simply named them "iphone4_iOS7" and "iphone5_iOS7".

Xcode, when viewing launch images in asset catalog

Names I have given the launch images



The launch images shown in the simulator when I run on iOS7 all turn up completely black, no matter which device. I also get this behaviour on my iphone 5, which confirms the simulator is not the problem. The same black image is shown when I run iOS6 in the ipad and ipad retina simulators. The launch images for the iphone simulators with iOS6 works as expected.

I have numerous times, both in simulator and on device, deleted the app and cleaned but it has not resulted in any improvement.

What am I doing wrong? How can I get rid of the black launch images and get the images I set in the asset catalog to show instead?

Sawn answered 17/10, 2013 at 10:25 Comment(1)
Are you certain that your app settings indicate to use the assets catalogue for the launch image?Commit
M
13

Have you changed the setting for your project so that it points to the Asset Catalog as the source for your Launch Image?

enter image description here

Merrick answered 17/10, 2013 at 11:3 Comment(8)
Oh my god! Of course this helped. I thought I had tested every possible thing, and it turns out to be this ridiculously simple. Somehow, I had choosen the source of the app icons to be the asset catalog but not the source of the launch images. I have spent hours, but you saved me the coming hours. Thank you!Sawn
@Sawn Hi, Jonathan and Oscar: if my App's target is originally iOS6 (even after update for iOS7, I am still targeting iOS 6), would I need to add the asset catalog in Xcode? Now it is not there. Thanks.Acicular
@Acicular I do not think there is a requirement to use the asset catalog. It is rather an option which should simplify things for you.Sawn
@Sawn Thanks. As long as it is not a requirement. But I will give it a try.Acicular
@Sawn Just one more thing: it simplifies things because the images will be automatically re-sized? What kind of simplifications you experienced using it? Thanks again.Acicular
@Acicular I don't think they are resized. I would say the simplification is about making the interface more graphical. It is easier to see if the images are what/where they should be. Also, it should also get rid of the requirement to give the images certain names. Though, I cannot confirm this.Sawn
@jonathan I have selected the Asset Catalog as my lunch image source and it works fine on the simulator, but when I run it on device the black screen appears instead, I've tried cleaning the project (Product > clean) and reinstalling the app but it didn't help... any suggestions?Funke
I just used png files instead of jpeg and and the exact same app is running alright!Funke
E
23

Make sure that Launch Screen File is empty! Making it empty solved the issue in my case

enter image description here

Endodermis answered 21/12, 2014 at 11:54 Comment(1)
Doh! So Simple. Also make sure you have the right size assets or you will get a compile errorUltrastructure
L
17
  • delete your app from your device
  • cmd + shift +k in your Xcode. then build it into your Device

launching images, only will be visible on your device if you reinstall on your device

UPDATE:

There is a weird issue what I found. If you are using LaunchScreen.xib and you have images in it, you have to do the tasks above and TURN OFF your device... (seriously...). Every image will be updated in the next build.

Lotson answered 17/10, 2013 at 10:28 Comment(3)
I have tried that already and it does not work. I will edit my question to state that as well.Sawn
After making these changes it only became visible if I deleted app and then reinstalled it on device!Comehither
I tried all solutions on SO. This is the only one that helped me. I've been struggling for hours to see the LaunchImage. After deleting the app, it suddenly appeared. Thanks Incmiko!Elson
M
13

Have you changed the setting for your project so that it points to the Asset Catalog as the source for your Launch Image?

enter image description here

Merrick answered 17/10, 2013 at 11:3 Comment(8)
Oh my god! Of course this helped. I thought I had tested every possible thing, and it turns out to be this ridiculously simple. Somehow, I had choosen the source of the app icons to be the asset catalog but not the source of the launch images. I have spent hours, but you saved me the coming hours. Thank you!Sawn
@Sawn Hi, Jonathan and Oscar: if my App's target is originally iOS6 (even after update for iOS7, I am still targeting iOS 6), would I need to add the asset catalog in Xcode? Now it is not there. Thanks.Acicular
@Acicular I do not think there is a requirement to use the asset catalog. It is rather an option which should simplify things for you.Sawn
@Sawn Thanks. As long as it is not a requirement. But I will give it a try.Acicular
@Sawn Just one more thing: it simplifies things because the images will be automatically re-sized? What kind of simplifications you experienced using it? Thanks again.Acicular
@Acicular I don't think they are resized. I would say the simplification is about making the interface more graphical. It is easier to see if the images are what/where they should be. Also, it should also get rid of the requirement to give the images certain names. Though, I cannot confirm this.Sawn
@jonathan I have selected the Asset Catalog as my lunch image source and it works fine on the simulator, but when I run it on device the black screen appears instead, I've tried cleaning the project (Product > clean) and reinstalling the app but it didn't help... any suggestions?Funke
I just used png files instead of jpeg and and the exact same app is running alright!Funke
M
6

The marked solution helped me figure out my problem:

I had added all the different sizes for the Launch Images, but during launch I would see a white background with black letters "(my app name)" in the center of the screen, with "copywrite (my name)" in small letters along the bottom.

I had specified the "Launch Images Source" to my Images.xcassets file, and added all the images for the correct sizes, but I did not notice that the "Launch Screen File" was still the default value of "LaunchScreen".

I made the "Launch Screen File" entry blank,and it started to use the Images.xcassets files correctly.

Thanks!

This was Xcode 6.1 running on the simulator, ios8.

Marjana answered 10/12, 2014 at 20:7 Comment(0)
N
2

Although this isn't the OPs issue in this case, this is for anyone was has multiple targets in their project: also make sure the asset catalog is included in all targets (if you're using a single catalog for all targets). In my case it had defaulted (or I had set it at some point in the past) to the first target, and thus my other targets had no launch screen. Strangely, they still had icons.

Nefarious answered 13/4, 2014 at 4:16 Comment(0)
T
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

Typography answered 23/10, 2015 at 6:22 Comment(0)
A
1

I have same problem. Tried all the solution posted here. Still nothing. Black screen only. After trial and error here and there, I found the solution. Delete the "Launch screen interface file..." in your project's PLIST. Delete the entry.

enter image description here

Delete the ENTIRE LINE!!! Don't leave it there with empty value.

Hope this helps someone.

Axiology answered 14/2, 2016 at 18:53 Comment(1)
This worked for me but I had to delete the app and re-install it after deleting the line.Japheth
S
0

For anyone stumbling on this question as I did:

If your app is landscape only, it won't load the LaunchImage if portrait is not a "supported orientation". You should always have portrait selected, next to the landscape orientation(s) you want to support.

See also: This question

Sydney answered 29/5, 2015 at 16:39 Comment(0)
S
0

Make sure the image is not transparent. In my case it is transparent instead of white

Stitt answered 29/2, 2016 at 11:45 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.