-
Notifications
You must be signed in to change notification settings - Fork 985
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
After upgrading to iOS 14 a black screen is quickly shown before splash screen appears ios #990
Comments
Not sure this is an issue specifically with cordova-plugin-splashscreen. I tried removing the plugin and added a new LaunchScreen storyboard with just an image and still had the same problem. Eventually managed to sort it by just removing the UILaunchStoryboardName entry from the {app name}-info.plist file. |
Try updating to the latest See Release Notes for more info. |
Thanks for replying. I updated my original text. I am using cordova-ios 6.1.1 indeed and the problem persists. |
the same bug on me |
I'm experiencing the same issue. When launched from Xcode it hangs on a black screen for about 20 seconds with nothing in the console. Then it springs to life and populates console -- but no errors or anything notable. When launched from iOS proper (after force quick) the black screen flashes very briefly, then splash screen, then app. This is new since upgrading to Cordova 10.0.0 and iOS platform 6.1.1. I'm also running the latest version of Xcode (12.0.1) |
Same for cordova-ios 5.1.1..can it be fixed without updating cordova ios? |
Depending on the root of the problem, it might work on cordova-ios 5.1.1. Even so, I recommend upgrading your project to the latest cordova-ios version as soon as possible. |
Issue persists, able to see black screen every time for few seconds before splash screen appears. |
Hey folks, Is the black screen happening right when you first launch the app, or does it show the launch screen for an instant and then show a black screen and then show the launch screen again? If the black screen is showing before the launch screen comes up, that sounds like an iOS issue that we wouldn't any control over. |
Thanks for replying, Yes every time i launch application first black screen appears for few seconds then splash screen is shown. If this issue is not related to cordova-ios could you pls tell me where to raise this issue ?? |
With the next gif you can see what happens. The black screen appears before the splashscreen. |
Black screen happening right every time when i first launch the app |
@harivenkatesh-id Did you try this? I think this is a change in how splashscreens are shown natively. The cordova splashscreen plugin emulates the native one, so this turns the native one off. It worked for me. |
I try the @goangus fix, and it worked, thanks!! :-D |
could you pls explain what you have done acutally in XCode ? |
Yeah, if you click on the project navigator icon (top left) and open up the Resources folder, you should see a file called |
|
Just as an FYI, that entry will be added back in every time you run |
If you right-click and click |
did not help (cordova ios 5.1.1) ... the screen of the whole application has shrunk |
This didn't help @goangus . whole app got shrunk and splash screen is not appearing able to see only white screen |
Well, you should be able to get back to where you were by rebuilding with cordova. Mine is on cordova ios 6.1.1. Maybe try updating to that version and see if it helps? |
i'm having cordova ios 6.1.1. still issue persists. |
i'm sorry to hear that, I'm not sure what else to suggest. I have |
Does this still happen with |
Hi @goangus Thanks for your reply. The problem persists to me even using corvoda ios 6.1.1. Removing the UILaunchStoryboardName entry won't work. Besides not working it also squeezes the app view port to the middle of the screen. Did you try it using a new device on simulator like "iPhone 11 Pro Max"? I believe if you try in an old device (small screen) it might give you the impression it is working correctly. Please take a look on how the app is presented after removing the UILaunchStoryboardName entry from the info.plist file: |
Yes. The problem persists with cordova-plugin-splashscreen 6.0.0 and also cordova-plugin-splashscreen 6.0.1-dev version |
@goangus works for me, many thanks! |
Note: removing |
Finally i use this solution: npm rm cordova-ios
npm i cordova-ios@5.1.1 config.xml <platform name="ios">
<hook src="scripts/patchStoryboard.sh" type="after_prepare" />
...
</platform> scripts/patchStoryboard.sh #!/bin/bash
if [[ ! -f /usr/libexec/PlistBuddy ]]; then
exit 0
fi
PLIST=./platforms/ios/*/*-Info.plist
/usr/libexec/PlistBuddy -c 'Delete UILaunchStoryboardName' $PLIST |
we may be missing the correct LaunchStoryboard sizes...
|
Sounds like a good fix. Did you try it? |
not yet... maybe tomorrow |
Guys I have it ... :-) It already works ... all dimensions need to be prepared ... don't ask me why, but it is so!
and run:
Make sure cordova added it to Images.xcassets ... |
Don't forget to invalidate the cache ... delete the application from your phone, turn off / on and clean the new install... viz link Cordova README |
Hi @davidpadych That's awesome! I thought this solution might work but I didn't have time to try it. Thanks for sharing! Will try it as soon as I have some time! The explanation is simple: iOS 14 is using a splash format other than the regular "Default@2x Will try this solution soon and will let you know about the results, Thanks! |
@davidtoledo Cordova resources doesn't generate following files automatically:
What the best way to create this resources before build and avoid errors ? |
@roman-rr Yes. It doesn't. You have to generate your splash screen files according to the instructions stated at: Here are the list of files and image aspects you have to generate: 2x* | universal | any | any | 2732x2732 | Default@2x You can generate these images manually using any image editor you like, Make sure all the important content (texts, logos, relevant figures) are inside the safe area into these images and generate the files according to the file names and image aspects listed above. ...and please let us know if the problem is solved after you make these changes. |
I prepared them manually in GIMP... I would add it as a requirement rather to the cordova-res plugin .. Cordova documentation:
|
I confirm that only adding the At the end we only have these assets: <splash width="2732" height="2732" src="www/res/splash/Default@2x~universal~anyany.png" />
<splash width="2732" height="2732" src="www/res/splash/Default@2x~universal~anyany~dark.png" />
<splash width="1334" height="1334" src="www/res/splash/Default@2x~iphone~anyany.png" />
<splash width="1334" height="1334" src="www/res/splash/Default@2x~iphone~anyany~dark.png" /> |
I can also confirm, replacing the screens and adding additional sizes has fixed the issue on my end. Works both in |
That's it! The solution is finally confirmed! As we can see, something changed in the way splash screens are handled in iOS 14: The entry Now we have to add this entry: For people using only the universal~anyany entry (the only entry necessary in previous iOS versions): you just have to add the iphone~anyany entry to your config.xml file and you are good to go. See example below:
Obviously you also have to create another image file called Default@2x Another thing that I noticed is that the splash screen fading effect is no longer working if the FadeSplashScreenDuration entry is not stated in the config.xml file. So, you just have to add this line to your config.xml file and you will get the same default fading effect as in the previous iOS versions:
Thank you very much for all collaborators in this thread. I believe the final solution is finally found! |
It works like charm!! Thanks @davidpadych @davidtoledo |
solvedx3! cordova 10.0.0 maybe this helps some one, I spent some hours updating our app, solving this new splash black screen issue, here the step-by-step: (i recommend building a new app just to make it work; zip/backup the original one)
some tips:
additional thoughts: |
Should this be solved in the Hello World template for new apps? Should this be documented - apache/cordova-docs#1144? |
I would say yes, at least for this builds specs.
…On Wed, Dec 30, 2020 at 1:23 AM Chris Brody ***@***.***> wrote:
Should this be solved in the Hello World template for new apps?
Should this be documented - apache/cordova-docs#1144
<apache/cordova-docs#1144>?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#990 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABIFMRR7L3HGONBTNZJJ27LSXJXHXANCNFSM4RSZ5PJQ>
.
|
@philippogol One of the things your mentioning as tips to remove the app and reinstall when the splash screen is not reflected is a known quirk with iOS and had already been mentioned in docs. Also, IMO I think it is not necessary to add anything to the hello world app. User should add their own splash screen. Additionally if we add, then we have to add for all various platforms, and then the users must replace all or delete... |
I'd say this is not a fix, but a workaround. I'd still like to have a feature where I provide a single image, and then the Cordova build process takes care of the sizes. |
Cordova supports this on iOS. See https://github.com/apache/cordova-plugin-splashscreen#single-image-launch-screen Note this only works well if your splashscreen is relatively simple. |
Of course, but not without the problem described in this issue. That's how I ended up here : ) |
It would sure be nice if this could be fixed - cordova-ios should be able to transform a universal-anyany image for iOS 14 devices just like it always did. Why was this ever closed when the bug still exists? There's no fix here or in the splashscreen plugin, @breautek. @philippogol The set of three images seems to at least improve the behavior. Cheers. |
Cordova has never transformed nor done any image manipulation, the thing is iOS "allowed" to have a single image that was displayed for all the devices, but on iOS 14, if the image is too big as recommended by the "single image" tip, it doesn't display on iPhone devices anymore. So it's not a cordova bug and cordova won't be doing anything to fix that, in any case document that it doesn't work for iOS 14 anymore on iPhone devices. |
Bug Report
Problem
It appears that the plugin is not working how it used to be on previous iOS versions. After upgrading to iOS 14, a black screen is shown very quickly before the real splash screen image is shown.
The easiest way to simulate the problem is using iOS simulator. A black screen will show up before splash and stay there for a few seconds. When I run on device, I can also see the black screen before splash but it happens very quickly.
What is expected to happen?
Splash screen is supposed to appear immediately after opening the app. A black screen is shown before the splash screen appears. Also the splash screen appears very quickly and disappears before the expected time compared to previous versions of the plug-in.
What does actually happen?
Black screen appears before splash screen
Information
I am using only the Default 2x universal image in my config.xml:
Additional splash screen configurations are:
Command or code
I am using cordova-plugin-splashscreen 6.1.1
Environment, Platform, Device
Version information
iOS 14
Cordova 10
Cordova android 9.0.0
Cordova ios 6.1.1
Checklist
The text was updated successfully, but these errors were encountered: