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

SplashScreen not loading on [email protected] #1401

Open
3 tasks done
adirgan opened this issue Feb 22, 2024 · 22 comments
Open
3 tasks done

SplashScreen not loading on [email protected] #1401

adirgan opened this issue Feb 22, 2024 · 22 comments
Labels
info-needed Further information is requested

Comments

@adirgan
Copy link

adirgan commented Feb 22, 2024

Bug Report

Problem

When I just prepared for iOS, everything is created correctly, and I manage to run the application in the iOS emulator, but the splash screen does not load, it remains blank

What is expected to happen?

When adding the iOS platform, the splash screen is created correctly and displayed when the app is run

What does actually happen?

When I prepared the app for iOS, everything was created correctly and I managed to run the app in the iOS emulator, but the home screen does not load, it remains blank.

Now when I try to manually place the Launch Screen File in General, and place the CDVLaunchScreen.storyboard and compile, the app no longer loads, every time I open the app it crashes with the following error.

"*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Could not find a storyboard named 'CDVLaunchScreen.storyboard' in bundle NSBundle"

I tried to create a Launch.storyboard myself in xcode, and it always gives me the same error that it cannot be found in the NSBundle.

I've been trying to figure out a solution for 10 hours, and I can't find any solution.

Information

Add iOS to a Cordova project in version 7.0.1, and prepare the project

Command or Code

Environment, Platform, Device

Mac OS, Sonoma

Emulator of iOS 17.2

Version information

Cordova CLI: 12.0.0
Cordova IOS: 7.0.1

Mac OS Sonoma, Xcode 15.2

Checklist

  • I searched for existing GitHub issues
  • I updated all Cordova tooling to most recent version
  • I included all the necessary information above
@taxman007
Copy link

running into the same issue. Was hoping Cordova Resources would do the trick, but no luck :(

@jcesarmobile
Copy link
Member

can you provide a sample app?

@jcesarmobile jcesarmobile added the info-needed Further information is requested label Mar 12, 2024
@adirgan

This comment was marked as abuse.

@taxman007
Copy link

Any idea what it could be?

@jcesarmobile @taxman007

Hmm. First, I would try to reinstall Cordova/ios

What I noticed with my Cordova IOS is that I had to manually add the respective splash screen, after running Cordova Resources. Seems like a bug in Cordova/iOS but I am also still running Ionic 6. So it could be a compatibility issue.

@adirgan
Copy link
Author

adirgan commented Apr 10, 2024

Could you give me a clearer idea of how you solved it?

Since I installed everything fresh, but it only happens when I upgrade to version 7

When you refer to adding the splash screen manually, what do you mean?

Sorry for the inconvenience, I've really been dealing with this for a long time and I need to solve it.

@taxman007 Thanks if you can help me

@halie412
Copy link

halie412 commented Apr 19, 2024

@adirgan

Hi, i was stucked on same error some hours and is related to documentation, you need add to config.xml all the spash images manually in actual size in your platform ios, the size of each image you can find in https://cordova.apache.org/docs/en/6.x/reference/cordova-plugin-splashscreen/

Take special attemption between universal and iphone are different, like:
Default@2x~universal~anyany.png is 2732px X 2732px
Default@2x~iphone~anyany.png is 1334px X 1334px

Each image are on root project / res / screen / ios

I add this to my config:

<platform name="ios"> <splash src="res/screen/ios/Default@2x~universal~anyany.png" /> <splash src="res/screen/ios/Default@2x~universal~comany.png" /> <splash src="res/screen/ios/Default@2x~universal~comcom.png" /> <splash src="res/screen/ios/Default@3x~universal~anyany.png" /> <splash src="res/screen/ios/Default@3x~universal~anycom.png" /> <splash src="res/screen/ios/Default@3x~universal~comany.png" /> <splash src="res/screen/ios/Default@2x~iphone~anyany.png" /> <splash src="res/screen/ios/Default@2x~iphone~comany.png" /> <splash src="res/screen/ios/Default@2x~iphone~comcom.png" /> <splash src="res/screen/ios/Default@3x~iphone~anyany.png" /> <splash src="res/screen/ios/Default@3x~iphone~anycom.png" /> <splash src="res/screen/ios/Default@3x~iphone~comany.png" /> <splash src="res/screen/ios/Default@2x~ipad~anyany.png" /> <splash src="res/screen/ios/Default@2x~ipad~comany.png" /> </platform>

@RachelQChen
Copy link

I had the same error, but I don't use SplashScreen.
My solution is: go to Info.plist, set the value of 'Launch screen interface file base name' to be 'CDVLaunchScreen', instead of 'CDVLaunchScreen.storyboard', delete '.storyboard', everything goes on smoothly then~

@matictrebusak
Copy link

I experienced this issue as well. I was getting two different splashes, first is native ios and then cordova splash, which did not scale and was shown as logo being off-center. Solution for me was:

  1. (may be optional) Add "Default@3xuniversalanyany.png" (2208x2208) as well to config.xml and resource folder. This asset should be smaller then @2x as referenced in cordova docs. If it uses 2x (2732X2732), which worked ok in cordova-ios@6+, it is actually too big , and you experience first black screen and then white screen because splash screen is not appropriately read. So my config for ios splash is:
    <splash src="resources/ios/splash/Default@2x~universal~anyany.png"/> <splash src="resources/ios/splash/Default@3x~universal~anyany.png"/>
  2. (needed) I found a fork in which a feature for rotating splash screens is reverted (was introduced in 7.0.0 I think) https://github.com/jessyefuster/cordova-ios/commits/7.1.1

I imagine this will be merged soon to main project and everything will be well again. Hope it helps someone in the meanwhile as I was stuck with this for one week.

@GitToTheHub
Copy link

GitToTheHub commented Aug 3, 2024

@matictrebusak You wrote:

which did not scale and was shown as logo being off-center.

I hade a similar issue. First the splashscreen was showed correctly and switched off-centered at the end. The issue was caused by the plugin cordova-plugin-googlemaps. After removing the plugin, the splashscreen was shown correctly durring the load time.

@ngoquoc
Copy link

ngoquoc commented Aug 30, 2024

@GitToTheHub I had the same issue, tried removing cordova-plugin-googlemaps and the problem disappeared. Have you maybe figured out what chunk of code in cordova-plugin-googlemaps that causes the issue? Thanks!

@GitToTheHub
Copy link

@ngoquoc No, I didn’t figure out, which part of the plugin causing the issue:/

@ngoquoc
Copy link

ngoquoc commented Sep 3, 2024

Thanks @GitToTheHub .

I tried the workaround suggested at #1401 (comment) by using that fork as:

cordova platform add --link https://github.com/jessyefuster/cordova-ios/tree/7.1.1

And it solves the problem. The only minor issue I have is the splashscreen disappears and blinks with background color filled (for less than a second) before the app loads. But that's a minor one and still acceptable to some certain extent. Many thanks to @matictrebusak for the workaround.

@GitToTheHub
Copy link

Ok good to know

@sajid-robo
Copy link

Hi,
We are encountering the same issue on iOS where the splash screen is replaced by a black screen before loading the main screen of the app. Any insights or solutions would be greatly appreciated. Thank you!

@jcesarmobile
Copy link
Member

black screen is caused by too big images, since iOS 14 devices don't seem to handle images of more than 100kb and bigger than 2400x2400px.

@maniya108
Copy link

Hi Team, Someone marked my comment as abuse. I dont know why. Getting splashscreen black and white issue after updated the latest cordova-ios 7.1.1. Please provide the workaround to overcome this issue. Thanks in advance!!!

@GitToTheHub
Copy link

Remove and add the ios platform again. Look in XCode, if you can see the associated splashscreens. Do you use png format for the splashscreen?

@maniya108
Copy link

Yes, Just now i removed and re-added the platform, also we are using universal image size as PNG format.
<splash height="2732" src="resources/ios/splash/Default@2x~universal~anyany.png" width="2732" />

@GitToTheHub
Copy link

You don't have to set height and width, just add:

<splash src="resources/ios/splash/Default@2x~universal~anyany.png" />

@maniya108
Copy link

Ok, Let me try

@iPMisterX
Copy link

@matictrebusak You wrote:

which did not scale and was shown as logo being off-center.

I hade a similar issue. First the splashscreen was showed correctly and switched off-centered at the end. The issue was caused by the plugin cordova-plugin-googlemaps. After removing the plugin, the splashscreen was shown correctly durring the load time.

same i dont know how to fix this i need to use cordova-plugin-googlemaps :(

@GitToTheHub
Copy link

@iPMisterX I made a PR to fix this mapsplugin/cordova-plugin-googlemaps#2936

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
info-needed Further information is requested
Projects
None yet
Development

No branches or pull requests