capacitor icon indicating copy to clipboard operation
capacitor copied to clipboard

bug: iOS 14 Black screen always on initial app launch prior to actually showing the splash screen [SplashScreen]

Open Exocomp opened this issue 5 years ago • 78 comments

This bug is for the SplashScreen plugin described here.

Create an ionic app with capacitor, deploy it on the simulator or physical device:

  1. Launch the application
  2. Get black screen <-- this was not here prior to iOS 14
  3. Transition to the actual splash image

Here is an example of a project where you can reproduce it: https://github.com/Exocomp/demo-ionic-swippable-modal.git

Ionic:

   Ionic CLI                     : 6.11.8 (/usr/local/lib/node_modules/@ionic/cli)
   Ionic Framework               : @ionic/angular 5.2.3
   @angular-devkit/build-angular : 0.1000.8
   @angular-devkit/schematics    : 10.0.8
   @angular/cli                  : 10.0.8
   @ionic/angular-toolkit        : 2.3.3

Capacitor:

   Capacitor CLI   : 2.4.1
   @capacitor/core : 2.4.1

Utility:

   cordova-res : 0.15.1
   native-run  : 1.1.0

System:

   NodeJS : v10.13.0 (/usr/local/bin/node)
   npm    : 6.4.1
   OS     : macOS Catalina

Exocomp avatar Sep 22 '20 00:09 Exocomp

Same here. Does someone have a workaround/quickfix for this?

AE1NS avatar Sep 24 '20 05:09 AE1NS

Launch screen with image stopped working with iOS 14, Xcode 12. Only workaround currently is to not use an image.

Deepfreezed avatar Sep 24 '20 19:09 Deepfreezed

Same issue here, ios 14 fresh cap app launch screen on ios is black. If anyone finds a solution please post

media4learning avatar Sep 28 '20 00:09 media4learning

I see the same issue happening, launch app --> black screen --> Splash

bolivir avatar Sep 29 '20 10:09 bolivir

I see the same issue happening, workaround for now, not use background image, replace it with a view and make the launch screen in there by hand.

francodelsancio avatar Sep 29 '20 16:09 francodelsancio

I have noticed a lot of apps displaying a black screen briefly before the launch screen on ios 14. I changed my SplashScreen plugin config to the below and the launch screen now displays: (delete the delay param)

"SplashScreen": { "launchAutoHide": false }

chrisdelambert avatar Sep 29 '20 23:09 chrisdelambert

I see the same issue happening, workaround for now, not use background image, replace it with a view and make the launch screen in there by hand.

@francodelsancio can you please provide some steps on how to do this.

@chrisdelambert "launchAutoHide": false doesn't work still has the black screen.

Exocomp avatar Sep 30 '20 02:09 Exocomp

@francodelsancio can you please provide some steps on how to do this. Sure, i remove the ImageView in LaunchScreen.storyboard and set a view instead, then i set the background color to the view, and added the logo with auto layout. I noticed that the images appear in the SDK but not in the device unless they are added in Bundle Resources (Build Phases).

Captura de Pantalla 2020-09-30 a la(s) 09 46 25

francodelsancio avatar Sep 30 '20 12:09 francodelsancio

@francodelsancio thanks for the steps, I tried it and it's not solving the issue. Correct me if I'm wrong but your steps just set the initial logo it doesn't affect the splash screen.

So this is what I see after your steps:

  1. Launch app
  2. See logo
  3. Transition from logo to black screen
  4. Transition from black screen to splash screen

So unfortunately it is still not working.

Exocomp avatar Oct 01 '20 13:10 Exocomp

I have noticed a lot of apps displaying a black screen briefly before the launch screen on ios 14. I changed my SplashScreen plugin config to the below and the launch screen now displays: (delete the delay param)

"SplashScreen": { "launchAutoHide": false }

Above was the solution for me, i removed the other entries i had in there like launchShowDuration. Now my config only contains the launchAutohide key. I just rebuilded the app and now i see no black screen appearing.

bolivir avatar Oct 01 '20 14:10 bolivir

@Exocomp i am sorry to hear that this not solve your problem, it seems, in my case, that the back screen is the background color coming from the imageView, because at run time its not loading from the resources, thats why i modify the launchscreen.storyboard, remove the imageView, added a view, set the background color, and put the logo. In configuration I also set it to start with that storyboard. Regards

francodelsancio avatar Oct 01 '20 14:10 francodelsancio

@francodelsancio it makes sense what you're saying but as soon as I add an image it goes to black, can you please include your LaunchScreen.storyboard file that will really help.

Exocomp avatar Oct 01 '20 16:10 Exocomp

@Exocomp i attach above an image of the tree in the splashscreen.storyboard if you change the background color of the elements you will notice that it is not loading the images. to load them you must attach them in the resource bundle. The assets folder are in the resource bundle, why are not loaded I don’t know. But the workaround works. All this assuming that we have the same problem. Regards

francodelsancio avatar Oct 02 '20 04:10 francodelsancio

Are there any updates on this problem here? Facing the same issues with the example app and its a pain point for me to see every time this black screen. Appreciate every help/workaround; the ones mentioned above didn't work for me.

Best regards

ghost avatar Oct 06 '20 11:10 ghost

Same problem here, black screen of the dead... it's totally anoying for user experience. I'v not found workaround... any solution here ? an update ?

ghost avatar Oct 07 '20 15:10 ghost

Same issue here, tried all workarounds explained above didn't work, I was able to fix it in Cordova by removing the UILaunchStoryboardName from the .plist file but it didn't work here

Faisal49m avatar Oct 08 '20 14:10 Faisal49m

I've tried all the proposed workarounds posted above and still have the same issue, usually with the black screen lasting for about 30 seconds to a minute before fully launching the app. It only happens on the first launch after installation; opening the app again a second time does not yield the black screen anymore. Are there any updates on this issue?

eddyD45 avatar Oct 16 '20 15:10 eddyD45

TLDR: What worked for me was to reduce file size of launch images.

I have 3 current Ionic/Capacitor/Angular apps. Two of them exhibit the same problem described here, initial black screen on app start prior to displaying actual launch image. The third never showed this problem and always started up fine.

After digging through all set-ups, configs, dependencies, ..., I found nothing to help my 2 problem apps. Just this morning I noticed the file size differences of the launch images: good app: 29KB problem apps: 145KB and 104KB

First I just pulled the launch images from the good app to one of problem apps and launch screen at start up was perfect, i.e. no black screen. Then I ran the launch images from 2 problem apps through squoosh - 145KB images reduced to 37KB and 104KB images reduced to 45KB. Put these new launch screen images into respective iOS apps and built onto my iPhone. Both app now start up perfectly with no black screen image.

Interesting note - both problematic apps are older and previously released to AppStore and have always worked fine. Something with iOS 14 definitely created this issue. Issue is not related to Xcode 12.

Possibly cordova resources would help this if used, but I have not tried.

I learned about squoosh from React Native Radio Podcast one of the most informative dev podcasts I've come across - even though I do no React Native development.

kinggolf avatar Oct 18 '20 17:10 kinggolf

I have 3 current Ionic/Capacitor/Angular apps. Two of them exhibit the same problem described here, initial black screen on app start prior to displaying actual launch image. The third never showed this problem and always started up fine.

Tried this and it does not work for me.

nachshonfertel avatar Oct 18 '20 18:10 nachshonfertel

Additional set up info in my apps, in case it helps, I am not using any splash screen plugin (Capacitor or Cordova). And no splash screen settings in capacitor.config.json. Just seems to work better for me.

kinggolf avatar Oct 18 '20 19:10 kinggolf

TLDR: What worked for me was to reduce file size of launch images.

I have 3 current Ionic/Capacitor/Angular apps. Two of them exhibit the same problem described here, initial black screen on app start prior to displaying actual launch image. The third never showed this problem and always started up fine.

After digging through all set-ups, configs, dependencies, ..., I found nothing to help my 2 problem apps. Just this morning I noticed the file size differences of the launch images: good app: 29KB problem apps: 145KB and 104KB

First I just pulled the launch images from the good app to one of problem apps and launch screen at start up was perfect, i.e. no black screen. Then I ran the launch images from 2 problem apps through squoosh - 145KB images reduced to 37KB and 104KB images reduced to 45KB. Put these new launch screen images into respective iOS apps and built onto my iPhone. Both app now start up perfectly with no black screen image.

Interesting note - both problematic apps are older and previously released to AppStore and have always worked fine. Something with iOS 14 definitely created this issue. Issue is not related to Xcode 12.

Possibly cordova resources would help this if used, but I have not tried.

I learned about squoosh from React Native Radio Podcast one of the most informative dev podcasts I've come across - even though I do no React Native development.

Strangely enough, this somewhat fixed the issue for me. After reducing the splash image size, my app will load the splash image immediately. However, this only seems to be masking the underlying issue, as I still have a 1~2 minute hang-time before my app properly loads and hides the splash image. Either way, this fixes the original issue at hand, so thank you.

eddyD45 avatar Oct 20 '20 17:10 eddyD45

I'll just throw my hat in the ring and also mention that i'm seeing this.

Had an older cordova project where indeed removing the UILaunchStoryboardName from plist worked, but haven't been able to solve it in capacitor :(

arcbus avatar Oct 30 '20 00:10 arcbus

Hang in there, next week I'll be releasing a new splash screen plugin that will fix all of these problems.

aparajita avatar Oct 30 '20 00:10 aparajita

It turned out to be an image resolution for me, it was 2700x2700 initially, I dropped it down to 2300x2300 and I don't get the black screen anymore. If you try this just make sure to backup your original image so once this issue is fixed you can start using the higher resolution again. Note that the size on the disk stayed pretty much the same so not a size on disk issue. Thumbs up if this works for you too. 👍

Exocomp avatar Oct 31 '20 20:10 Exocomp

@aparajita Any progress on this? We really waiting for this fix... 😞

yacut avatar Nov 10 '20 12:11 yacut

@yacut Hopefully this week. I'm actually working on 3 killer plugins: splash screen, biometric auth, and console. It will be worth the wait. 😁

aparajita avatar Nov 10 '20 17:11 aparajita

@aparajita hi my friend! any progress on this?

angelolencina avatar Nov 22 '20 16:11 angelolencina

@angelolencina 3 killer plugins became 4 😁, and I had a lot of work to do for my job, so it was a busy week. It looks good for releasing the splash screen plugin this week.

aparajita avatar Nov 22 '20 18:11 aparajita

@angelolencina 3 killer plugins became 4 😁, and I had a lot of work to do for my job, so it was a busy week. It looks good for releasing the splash screen plugin this week.

Ok. Thank you!! 😁👍

angelolencina avatar Nov 22 '20 19:11 angelolencina

Hey @aparajita, do you have any news about the splash screen plugin?

At the moment our iOS App has a black screen and the Android App has a colored background (instead of a stretched image) before the ionic splash is displayed. Unfortunately there seems to be no proper solution until you rescue us 👍 Thank you for your effort, this sounds really great!

AE1NS avatar Nov 30 '20 14:11 AE1NS