Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS - White screen before splash screen #9

Closed
Aljulanda9 opened this issue Aug 28, 2019 · 34 comments
Closed

iOS - White screen before splash screen #9

Aljulanda9 opened this issue Aug 28, 2019 · 34 comments
Labels
bug Something isn't working

Comments

@Aljulanda9
Copy link

Aljulanda9 commented Aug 28, 2019

Hi, thanks for the wonderful package. It saved me a lot of time. I have a small issue with the iOS splash screen. It works fine, but there's a white screen right before the splash screen that I specified. Have you seen this before or would you know of a way to get rid of that initial white screen? Thanks

  • Edit: device is iPhone 6
@henriquearthur
Copy link
Collaborator

I can not reproduce this on iOS emulator and unfortunately I don't have a Mac or real device to test this on.

Can you provide more information like:

  • Are you using Objective-C or Swift?
  • Does this happens only on the iPhone 6 or emulator as well?
  • Please share your ios/Runner/Base.lproj/LaunchScreen.storyboard

@henriquearthur henriquearthur added ios waiting response Further information is requested labels Aug 28, 2019
@01xJoao
Copy link

01xJoao commented Sep 4, 2019

Hello @henriquearthur

I'm having the same problem, this happens on physical device but also on the emulator.

Video (Also I don't think that black screen in the end is normal?)

File of my launchScreen.storyboard: Storyboard

@henriquearthur
Copy link
Collaborator

@joaowd thank you for sharing the video, it is really helpful.

I will look into this soon.

@henriquearthur henriquearthur added bug Something isn't working and removed waiting response Further information is requested labels Sep 5, 2019
@pph7
Copy link

pph7 commented Sep 5, 2019

Hi, @henriquearthur first I want to say thank you for the great plugin, I was exactly looking for something like this.
The only issue is, I have the same problem like @joaowd. There is a blank white screen showing before the actual splash screen.
The interesting thing is, that I had the same effect when I created my splash screen manually by modifiying the LaunchScreen.storyboard provided by flutter. I am struggling with this the whole day now.

@pph7
Copy link

pph7 commented Sep 5, 2019

BTW I am working with XCode 10.3 and so far I have seen this issue on the simulator, I did not test it on a real device yet. Here is my LaunchScreen.storyboard

https://gist.github.com/pph7/eb64869986fcf2336eeb69dc2dca0bc0

@01xJoao
Copy link

01xJoao commented Sep 5, 2019

@pph7 and @henriquearthur Can you guys please test if your app hides the status bar on landscape when you use this package?

Since I installed this the status bar doesn't disappear on landscape.

@pph7
Copy link

pph7 commented Sep 5, 2019

@joaowd sorry I can't reproduce this because my app does not run in landscape mode. Maybe open another issue?

@01xJoao
Copy link

01xJoao commented Sep 5, 2019

@pph7 I would but I don't really know if the problem is related.

@henriquearthur
Copy link
Collaborator

henriquearthur commented Sep 5, 2019

@Aljulanda9 @joaowd @pph7 I have tried to reproduce this issue on a iPhone XR and iPhone 6 simulator but had no success.

I tried to create a fresh project with flutter create, setting up the package and running it. No white screen. I also tried running a personal project - which has more complex loading with Firebase and BLoC, but still no white screen.

Can't reproduce this on default counter example and not in a more complex app.

Also can't reproduce by copying the LaunchScreen.storyboard you guys provided @joaowd @pph7

As you can see on the gif, there is no white or black screen.

Can you guys check if this issue occurs with a fresh flutter project (counter example)?

Maybe the reason I can't reproduce is because my apps are too simple, although I don't think that is a problem given the way that Flutter works, but still I would like to investigate all possibilities. Or maybe is because I'm testing on an emulator inside a Mac OS VM, but if anything that should be a limitation.

ezgif com-video-to-gif

@henriquearthur
Copy link
Collaborator

henriquearthur commented Sep 5, 2019

@joaowd

Can you guys please test if your app hides the status bar on landscape when you use this package?

Since I installed this the status bar doesn't disappear on landscape.

Tested on fresh app and existing personal app, on both the status bar is hidden during splash screen on landscape mode.

  • Have you modified UIViewControllerBasedStatusBarAppearance on Info.plist? (default is false)
  • Does it work on portrait?

Please open a new issue so we can keep discussions separated.

@pph7
Copy link

pph7 commented Sep 6, 2019

@henriquearthur I created a new flutter app and with your plugin, the image shows from the beginning. I noticed though now that when I change the background color in the settings of flutter_native_splash the color shows from the beginning, jus the image is delayed. I will investigate further.

@pph7
Copy link

pph7 commented Sep 6, 2019

I was able to solve this issue for me. It turns out to be a caching issue with Flutter and XCode. After I did

flutter clean

and resetted the simulated iOS device, the screen showed without a delay.

@01xJoao
Copy link

01xJoao commented Sep 6, 2019

@pph7 flutter clean, didn't solve my problem

@pph7
Copy link

pph7 commented Sep 6, 2019

@joaowd did you also reset the simulator?

@01xJoao
Copy link

01xJoao commented Sep 6, 2019

@pph7 What do you mean ? Quit and Open the simulator again ?

This also happens on physical devices

@pph7
Copy link

pph7 commented Sep 6, 2019

Erase all Content and Settings https://stackoverflow.com/a/9088416/284577

@01xJoao
Copy link

01xJoao commented Sep 6, 2019

@pph7 That actually worked! But how do we fix this on a real device ?

(Maybe wont happen on a fresh device ? 🤔)

@01xJoao
Copy link

01xJoao commented Sep 6, 2019

Alright for some weird reason, It started working well on a real device.

@pph7
Copy link

pph7 commented Sep 6, 2019

@joaowd Great! Caching issues related to the launch screen seem to be very common, as I read in a couple of stackoverflow questions, many of them unrelated to flutter.

@henriquearthur
Copy link
Collaborator

As @pph7 pointed out this seems to be a caching problem in iOS development (not related to Flutter or flutter_native_splash) and also a frequent issue:


Explaining to future readers: flutter clean will delete your build so you have to build again from original code and resetting iOS simulator will clear out the cache.

I will add this information to README on next version so people can solve this quickly.

@Aljulanda9 please try this steps on your app and let us know if it works for you too. I am closing this issue because the solution works for other people with same problem - but if it doesn't work for you then please reopen so we can dig deeper.

And thanks @pph7 for the solution!

@Aljulanda9
Copy link
Author

Hi yes the trick worked. Thank you very much :)

@pph7
Copy link

pph7 commented Sep 7, 2019

Happy to help

@esenmx
Copy link

esenmx commented Nov 28, 2019

I have same issue and even flutter clean does not solve the issue. There is video from mtechviral and he says that delay related the wrong spec image. But it's just a simple png what could be wrong?

@pph7
Copy link

pph7 commented Nov 28, 2019

@softronaut did you also try to reset the simulator?

@esenmx
Copy link

esenmx commented Nov 28, 2019

@pph7 yes, right now I tried with different device, same issue. Actually I realised this issue after ipa build. I think this is iOS issue in general.

@pph7
Copy link

pph7 commented Nov 28, 2019

@softronaut right, an iOS issue and a caching issue in particular

@esenmx
Copy link

esenmx commented Nov 28, 2019

I can confirm it's related the image file and caching. I'm not expert at images but I was using a file exported from Photoshop. Now I used a generator and I think it changes the files structure, now it's loading instantly.

@esskar
Copy link

esskar commented Jun 24, 2020

@softronaut what image sizes are you using?

@esenmx
Copy link

esenmx commented Jun 24, 2020

@softronaut what image sizes are you using?

It was not related to size as far as I remember. Just try to optimize image via some web services or save again in something like GIMP, Krita etc. then try again. That's how I managed to solve it.

@ghost
Copy link

ghost commented Jul 2, 2020

@softronaut How did you manage to solve this issue? I mean what optimization did you apply to the image using GIMP or Krita? I tried the flutter clean method and nothing is being solved

@esenmx
Copy link

esenmx commented Jul 2, 2020

@softronaut How did you manage to solve this issue? I mean what optimization did you apply to the image using GIMP or Krita? I tried the flutter clean method and nothing is being solved

There are web services for image size optimization, you can try them. As far as I remember I didn't do any optimization in my case, just did Save as(may be GIMP or may be Preview tool from Mac I can't remember exactly) and it worked.

The point is here, when you save or export image from any other software, it changes the image internally according it's algorithm and that's somehow solves the problem sometimes.

@yourshinsuke
Copy link

did you fix?

@pph7
Copy link

pph7 commented Sep 8, 2020

@yourshinsuke please check my reply, it is most likely a caching issue

@wlgnsdi
Copy link

wlgnsdi commented Jan 4, 2022

Erase all Content and Settings https://stackoverflow.com/a/9088416/284577

Thanks!! this is my answer!! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

8 participants