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

Splash Screen scaling displays twice #1627

Closed
2 of 7 tasks
johnwargo opened this issue Jun 3, 2019 · 64 comments
Closed
2 of 7 tasks

Splash Screen scaling displays twice #1627

johnwargo opened this issue Jun 3, 2019 · 64 comments

Comments

@johnwargo
Copy link

Description of the problem:
I followed the instructions to configure splash screen scaling described here: https://capacitor.ionicframework.com/docs/apis/splash-screen/#configuration. When the app launches, Capacitor displays my splash screen scaled incorrectly, then adjusts to the scaling I have in my capacitor.config.json file:

"plugins": {
    "SplashScreen": {
      "launchShowDuration": 1000,
      "launchAutoHide": true,
      "androidSplashResourceName": "splash",
      "androidScaleType": "CENTER_CROP"
    }
  },

What I'm expecting is that the splash screen displays once, at the specified scale.

Affected platform

  • Android
  • iOS
  • electron
  • web

OS of the development machine

  • Windows
  • macOS
  • linux

Other information:

Capacitor version:
5.0
node version:
10.15.3
npm version:
6.9.0
CocoaPods version:

Steps to reproduce:
As described above.

Link to sample project:

@jcesarmobile
Copy link
Member

Unlike Cordova, which first shows a grey empty screen and then the splash screen, Capacitor is able to show the splash image from the beginning. But this "trick" is done by first showing theme with the image and then a native view showing the same image (similar to iOS where it first shows the launch storyboard and then the native image).
For some reason, in your case, the theme and the native view don't match and you see the transition from one to the another.

Would be helpful if you could provide the images you are using, or even better if you can provide a sample project.

Meanwhile, if the effect is very annoying for you, you can just remove android:theme="@style/AppTheme.NoActionBarLaunch" from the activity and then it will behave like Cordova apps, showing an empty screen before the native screen with the splash image.

@johnwargo
Copy link
Author

johnwargo commented Jun 7, 2019

@jcesarmobile I can make a sample project that shows this, but won't be able to do so for a couple of weeks. Can you delete these once you pull it down?

@digaus
Copy link
Contributor

digaus commented Jul 31, 2019

I got the same issue... first splash is stretched and then shown correctly. Removing android:theme="@style/AppTheme.NoActionBarLaunch" is a good workarround though

@vfportero
Copy link

Having the same issue here wiht a Xiami MI A9SE (5.97-inch touchscreen display with a resolution of 1080x2340 pixels at a pixel density of 432 pixels per inch)

In my case Android is using the xxhdpi image that is this one: https://user-images.githubusercontent.com/1107782/65594996-1317ee00-df94-11e9-9d3c-b0aa3dc56e9e.png

And this is a GIF of the bad behaviour:
ezgif-4-b12117d410fc

As you can see, the first image show is deformed and then have a FOUC to the actual splash screen with androidScaleType set as CENTER_CROP

@KevinSleegers
Copy link

KevinSleegers commented Nov 26, 2019

Any news on how to fix this?

I'm currently facing the same issue where the scaling of the initial splash image does not match the androidScaleType: CENTER_CROP I've defined in capacitor.config.json.

I also did try to remove the android:theme="@style/AppTheme.NoActionBarLaunch" but then the screen is white at first which looks odd since my splash screen is a red image. I haven't been able to find a way to change the background color since that would also kind of solve the issue at this moment. If anyone knows how to do achieve that, please let me know :)

Thanks in advance,
Kevin

@raycarter
Copy link

Same issue

@katzenjunge
Copy link

This issue still is a problem. Hoping this will get fixed :)

@peterpeterparker
Copy link
Contributor

peterpeterparker commented Dec 31, 2019

Instead of removing android:theme="@style/AppTheme.NoActionBarLaunch" as @jcesarmobile suggested, which would display a grey screen before booting your splash, I suggest to set a color as workaround for this first screen, in my case my splash screen main predominant background.

In file android/app/src/main/res/values/styles.xml modify AppTheme.NoActionBarLaunch with your background color, for example:

<style name="AppTheme.NoActionBarLaunch" parent="AppTheme.NoActionBar">
  <item name="android:background">#230F29</item>
</style>

Doing so it is at least a bit less flashy

ezgif com-video-to-gif

@digaus
Copy link
Contributor

digaus commented Dec 31, 2019

This issue still is a problem. Hoping this will get fixed :)

Tried to fix it myself but it is quite hard or not even possible since you also would have to respect the androidScaleType.
Don't know if @jcesarmobile has an idea how to solve that.

@alexcroox
Copy link

@peterpeterparker nice work around with the background colour, thank you!

@xzilja
Copy link
Contributor

xzilja commented Feb 2, 2020

This becomes big issue if custom splash screen is made i.e. in iOS using lottie animation or something it initially shows that screen, then goes to second one that shows just static splash screen image. Is there a way to leave just one of them for easier and more consistent maintenance?

@jcesarmobile
Copy link
Member

As I explained, the way it works is by first showing a theme with the image as background and then a native view showing the same image. This works fine for simple images, but for more complex images you'll have to tweak your theme, or try 9-Patch images.

With the OP's provided images, there is no noticeable change from the background image to the native image if using the default FIT_XY, but of course, the image is not properly sized.

Sadly the background image can't be sized, I think the people is getting confused because there was a launch_splash.xml file that had android:scaleType="centerCrop" on it.
But that file was not being used, and even if the user changes the theme to use the file, the android:scaleType="centerCrop" doesn't work on bitmaps, only on ImageViews (And ImageViews can't be used in a drawable).

We have removed that file to avoid this kind of confusions. (see #2411).

Though, for the OP's provided images, I've found another way of displaying the image with the "androidScaleType": "CENTER_CROP" configuration option.
This way is showing the Splash image in full screen mode (available on Capacitor 1.5.0).

First in capacitor.config.json add

"androidScaleType": "CENTER_CROP",
"splashFullScreen": true

Then change the theme to also show in full screen

<style name="AppTheme.NoActionBarLaunch" parent="AppTheme.NoActionBar">
    <item name="android:windowNoTitle">true</item>
    <item name="android:windowActionBar">false</item>
    <item name="android:windowFullscreen">true</item>
    <item name="android:background">@drawable/splash</item>
</style>

Going to close since we can't really do anything about this since the launch theme has this limitations, if it doesn't work for you try one of the mentioned workarounds:

  1. Use FIT_XY
  2. Remove the theme (a grey area will be shown instead)
  3. Keep the theme but remove the image and use a color instead
  4. Use a full screen theme and full screen splash screen.

@jcesarmobile jcesarmobile mentioned this issue Mar 23, 2020
4 tasks
@sofiageo
Copy link

sofiageo commented Mar 26, 2020

@jcesarmobile Point 4 is not working. The drawable splash screen is always FIT_XY and ignores scaletype. The only way it worked was by replacing android:background with android:src - but then my app crashes from missing images:

android.content.res.Resources$NotFoundException: Drawable android:drawable/edit_text_material with resource ID #0x108029e
    Caused by: java.lang.RuntimeException: org.xmlpull.v1.XmlPullParserException: <internal>: <nine-patch> requires a valid 9-patch source image

@alex-steinberg
Copy link

I am migrating a Cordova app to Capacitor and am experiencing this problem using the exact same splash images the Cordova app renders perfectly. The workaround of adding a background colour works but it's a degradation. I'd love to see Lottie support in Capacitor, that would make this problem disappear and allow us to deliver the best possible user experience. Unfortunately, the Cordova plugin doesn't work: timbru31/cordova-plugin-lottie-splashscreen#188

@daveshirman
Copy link

@peterpeterparker This is the only acceptable solution here. It's honestly pathetic that this isn't mentioned in the Capacitor docs, as if it's a perfect replacement for Cordova splash out of the box.

@mlynch @mhartington This is not good enough. If you want people to trust Capacitor over Cordova, get these basic things right and make sure the docs are correct please.

For anyone else, this is my capacitor.config.json:

  "plugins": {
    "SplashScreen": {
      "launchAutoHide": false,
      "androidScaleType": "CENTER_CROP",
      "showSpinner": true,
      "splashFullScreen": false,
      "splashImmersive": false
    }
  }

My styles.xml - where the hex is the same colour as the background on my splash:

    <style name="AppTheme.NoActionBarLaunch" parent="AppTheme.NoActionBar">
        <item name="android:background">#4D4D4D</item>
    </style>

NOTE: I have autohide set to false as I programatically hide when I'm ready.

@Boby
Copy link

Boby commented May 21, 2020

+1 on @daveshirman comment, this is happening on capacitor 2.0 also I find quite frustrating for basic stuffs but essential and we have to effortly fix this issue and yes I used the @peterpeterparker method for now and that is the only visible way of solving the issues.

@Nuajan
Copy link

Nuajan commented May 25, 2020

Hi,
having the same issue and digged on Ionic Forums and find the following.
Just appying as follows it did the job for me, without setting up a color as @peterpeterparker said (it also works but this seems to do the trick on a better way).
Check it out.

<style name="AppTheme.NoActionBarLaunch" parent="AppTheme.NoActionBar"> <item name="android:windowNoTitle">true</item> <item name="android:windowActionBar">false</item> <item name="android:windowFullscreen">true</item> <item name="android:windowContentOverlay">@null</item> <item name="android:windowIsTranslucent">true</item> </style>

By the way, i also agree such a simple thing to be so frustating. Maybe not the worst issue on an app but, if all customers have a similarity all around the world is for putting their eyes in such little things - just opening the app - before all the incredible effort behind the scenes.

Regards.

@losciur
Copy link

losciur commented Jun 1, 2020

THANKS @Nuajan
THIS IS THE SOLUTION FOR ME!

PS: i also agree such a simple thing to be so frustating.

@danielehrhardt
Copy link

danielehrhardt commented Jun 28, 2020

Hi,
having the same issue and digged on Ionic Forums and find the following.
Just appying as follows it did the job for me, without setting up a color as @peterpeterparker said (it also works but this seems to do the trick on a better way).
Check it out.

<style name="AppTheme.NoActionBarLaunch" parent="AppTheme.NoActionBar"> <item name="android:windowNoTitle">true</item> <item name="android:windowActionBar">false</item> <item name="android:windowFullscreen">true</item> <item name="android:windowContentOverlay">@null</item> <item name="android:windowIsTranslucent">true</item> </style>

By the way, i also agree such a simple thing to be so frustating. Maybe not the worst issue on an app but, if all customers have a similarity all around the world is for putting their eyes in such little things - just opening the app - before all the incredible effort behind the scenes.

Regards.

Could you share your capacitor.config.json?

btw. between the App Start and the Splash Screen and the WebView load there is a quick blank background with a Color that i am not able to change. Do you know where I can change that?

@danielehrhardt
Copy link

This is how i do it now:

app.component.ts

setTimeout(() => {
      SplashScreen.hide();
    }, 300);

styles.xml

<style name="AppTheme.NoActionBarLaunch" parent="AppTheme.NoActionBar">

    </style>

capacitor.config.json

"plugins": {
    "SplashScreen": {
      "launchAutoHide": false,
      "showSpinner": true,
      "androidSpinnerStyle": "small",
      "iosSpinnerStyle": "small",
      "spinnerColor": "#ffffff",
      "backgroundColor": "#21252dff",
      "splashFullScreen": true,
      "androidScaleType": "CENTER_CROP",
      "splashImmersive": false
    }
  },

This was with the native Android start Animations the smoothest way.

@maxime-guyot
Copy link

The solution of @Nuajan cause crash on android 8 if you set android:screenOrientation="portrait on AndroidManifest.xml
Exception : java.lang.IllegalStateException: Only fullscreen opaque activities can request orientation

To solve problem you should :

  • remove android:screenOrientation="portrait on AndroidManifest.xml
  • set orientation on MainActivity.java :
if (android.os.Build.VERSION.SDK_INT > Build.VERSION_CODES.O) {
    setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
}

@rajdevkar
Copy link

Hi,
having the same issue and digged on Ionic Forums and find the following.
Just appying as follows it did the job for me, without setting up a color as @peterpeterparker said (it also works but this seems to do the trick on a better way).
Check it out.

<style name="AppTheme.NoActionBarLaunch" parent="AppTheme.NoActionBar"> <item name="android:windowNoTitle">true</item> <item name="android:windowActionBar">false</item> <item name="android:windowFullscreen">true</item> <item name="android:windowContentOverlay">@null</item> <item name="android:windowIsTranslucent">true</item> </style>

By the way, i also agree such a simple thing to be so frustating. Maybe not the worst issue on an app but, if all customers have a similarity all around the world is for putting their eyes in such little things - just opening the app - before all the incredible effort behind the scenes.

Regards.

This Worked! Thank you

@DuebassLei
Copy link

DuebassLei commented Jul 15, 2020

When the app launches, ,I found twice splash.I fixed:

    <!-- default -->
    <style name="AppTheme.NoActionBarLaunch" parent="AppTheme.NoActionBar">
        <item name="android:background">@drawable/splash</item>
    </style>
  
    <!-- modified-->
    <style name="AppTheme.NoActionBarLaunch" parent="AppTheme.NoActionBar">
        <item name="android:background">@null</item>
    </style>

@Snowbases
Copy link

So frustrating, It takes me the whole night to fix this.

@danielehrhardt
Copy link

So frustrating, It takes me the whole night to fix this.

How did you fixed it?

@vishnuvardhana
Copy link

After spending a lot of time on this I found solution for my app.

In AndroidManifest.xml use android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen" rather than using NoActionBar.

Cheers,

@danielehrhardt
Copy link

Just an FYI, hopefully this week I'll be releasing a new splash screen plugin that will let you use layouts as the splash screen and add your own custom animation code without having to hack Capacitor.

Did you released it somewhere?

@aparajita
Copy link

@danielehrhardt Coming later this week hopefully. The code is done, I have to document everything and make some examples.

@AE1NS
Copy link

AE1NS commented Dec 10, 2020

@aparajita Am I right, that your plugin does not affect the native splash image in the first second when launching the app? One Android problem is the stretched image in the first second on certain devices (Pixel 4, Galaxy S20, ...), so I removed the image in my case and set a background color. After this second, the Capacitor Splashscreen or your Splashscreen take over and shows the image properly. But the initial problem with this stretched image cant be fixed, neither with your plugin, right?

@aparajita
Copy link

aparajita commented Dec 10, 2020

Until some changes are made to the way things are done in Capacitor, there isn't much you can do on Android. We are actively working on addressing this in Capacitor 3 so that launch screens will seamlessly transition to the plugin splash screen.

@bitflower
Copy link

bitflower commented Feb 3, 2021

@sergiuturus You want this solution from above: #1627 (comment)

I just tried it and also still had a streched image.

@sergiuturus
Copy link

sergiuturus commented Feb 3, 2021

EDIT: I added "androidScaleType": "CENTER_CROP" and I thought the splash image was stretched but it seems like the loading spinner is not being centered. Here are 2 screenshots from 2 apps: capacitor (not centered) and cordova.

https://imgur.com/ZuH8Y90
https://imgur.com/a/i0p3kJA

Any idea why this is happening?

@AE1NS
Copy link

AE1NS commented Feb 8, 2021

@aparajita Did you/the capacitor team already find a solution for the initial stretched splashscreen issue to be release with capacitor 3?

@preeti6695
Copy link

So frustrating, It takes me the whole night to fix this.

can you tell me solution for this?

@preeti6695
Copy link

please give me some refrences

@thesurya9
Copy link

@peterpeterparker This is the only acceptable solution here. It's honestly pathetic that this isn't mentioned in the Capacitor docs, as if it's a perfect replacement for Cordova splash out of the box.

@mlynch @mhartington This is not good enough. If you want people to trust Capacitor over Cordova, get these basic things right and make sure the docs are correct please.

For anyone else, this is my capacitor.config.json:

  "plugins": {
    "SplashScreen": {
      "launchAutoHide": false,
      "androidScaleType": "CENTER_CROP",
      "showSpinner": true,
      "splashFullScreen": false,
      "splashImmersive": false
    }
  }

My styles.xml - where the hex is the same colour as the background on my splash:

    <style name="AppTheme.NoActionBarLaunch" parent="AppTheme.NoActionBar">
        <item name="android:background">#4D4D4D</item>
    </style>

NOTE: I have autohide set to false as I programatically hide when I'm ready.

Thanks brother <3

@justindfunk
Copy link

Same issue. For some reason I couldn't figure out how to hide the splash screen from the code, but by tweaking a few backgrounds based on the responses here, I got it close enough to what I wanted. Not perfect, just close enough.

And yes, this whole thing is completely ridiculous. Literally every person who makes an app on this platform has to go through the splash screen, so how is this even still an issue? How was it ever released in this state in the first place?

Everything I've gone through today trying to solve this, and a few other things that should be fundamental, it's finally convinced me to abandon Ionic completely and go check out React Native. I've been using Ionic for years and it's just been one disaster after another with bad documentation, constant refactoring and dependency conflicts, and absolutely garbage support from the Ionic team. Good riddance.

@zLinz
Copy link

zLinz commented Aug 23, 2021

Hi,
having the same issue and digged on Ionic Forums and find the following.
Just appying as follows it did the job for me, without setting up a color as @peterpeterparker said (it also works but this seems to do the trick on a better way).
Check it out.

<style name="AppTheme.NoActionBarLaunch" parent="AppTheme.NoActionBar"> <item name="android:windowNoTitle">true</item> <item name="android:windowActionBar">false</item> <item name="android:windowFullscreen">true</item> <item name="android:windowContentOverlay">@null</item> <item name="android:windowIsTranslucent">true</item> </style>

By the way, i also agree such a simple thing to be so frustating. Maybe not the worst issue on an app but, if all customers have a similarity all around the world is for putting their eyes in such little things - just opening the app - before all the incredible effort behind the scenes.

Regards.

this resolve my problem. thanks bro!

@syuraj
Copy link

syuraj commented Aug 29, 2021

How about new drawable?

<?xml version="1.0" encoding="utf-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <item android:drawable="@color/ic_launcher_background"/> <item android:width="200dp" android:height="200dp" android:drawable="@drawable/ic_launcher_foreground" android:gravity="center" /> </layer-list>

and use it like this
<style name="AppTheme.NoActionBarLaunch" parent="AppTheme.NoActionBar"> <item name="android:background">@drawable/bootsplash</item> </style>

@johannds
Copy link

johannds commented Aug 30, 2021

Try this on for size in your capacitor config:

 "plugins": {
  	"SplashScreen": {
			"launchAutoHide": false,
			"androidScaleType": "FIT_XY",
			"backgroundColor": "#000000",
			"showSpinner": false,
                         "splashFullScreen": false,
                         "splashImmersive": false
		}
  },

IMPORTANT: DO NOT FORGET TO UPDATE src/main/assets/capacitor.config.json WITH THE SAME VALUES.

This made the issue go away on my side. I suspect there is an issue somewhere in the code that deals with offsets when the screen is fullscreen or immersive.

ALSO IMPORTANT: you might want to turn launchAutoHide on, unless you manually hide the splash screen in code.

@liho00
Copy link

liho00 commented Sep 11, 2021

Try this on for size in your capacitor config:

 "plugins": {
  	"SplashScreen": {
			"launchAutoHide": false,
			"androidScaleType": "FIT_XY",
			"backgroundColor": "#000000",
			"showSpinner": false,
                         "splashFullScreen": false,
                         "splashImmersive": false
		}
  },

IMPORTANT: DO NOT FORGET TO UPDATE src/main/assets/capacitor.config.json WITH THE SAME VALUES.

This made the issue go away on my side. I suspect there is an issue somewhere in the code that deals with offsets when the screen is fullscreen or immersive.

ALSO IMPORTANT: you might want to turn launchAutoHide on, unless you manually hide the splash screen in code.

tried, same scaling twice

@sathishsundar05
Copy link

Hi,
having the same issue and digged on Ionic Forums and find the following.
Just appying as follows it did the job for me, without setting up a color as @peterpeterparker said (it also works but this seems to do the trick on a better way).
Check it out.

<style name="AppTheme.NoActionBarLaunch" parent="AppTheme.NoActionBar"> <item name="android:windowNoTitle">true</item> <item name="android:windowActionBar">false</item> <item name="android:windowFullscreen">true</item> <item name="android:windowContentOverlay">@null</item> <item name="android:windowIsTranslucent">true</item> </style>

By the way, i also agree such a simple thing to be so frustating. Maybe not the worst issue on an app but, if all customers have a similarity all around the world is for putting their eyes in such little things - just opening the app - before all the incredible effort behind the scenes.

Regards.

That really works, great work

@enginkarabel
Copy link

Hi,

I use different workaround. I add custom_splash.xml at android drawable resource and edit styles.xml.

Capacitor.config.json

"plugins": {
    "SplashScreen": {
      "launchAutoHide": true,
      "launchShowDuration": 2000,
      "androidScaleType": "CENTER_CROP"
    }
 }

styles.xml

<style name="AppTheme.NoActionBarLaunch" parent="AppTheme.NoActionBar">
        <item  name="android:background">@drawable/custom_splash</item>
</style>

custom_splash.xml

<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
    <item
        android:background="@drawable/splash"
        android:scaleType="centerCrop" />
</layer-list>

This works fine for me.

@Pacjonek
Copy link

Pacjonek commented Jan 4, 2022

Shame and disgrace that AFTER MORE THAN TWO YEARS (sic!) since the bug was reported, it still hasn't been resolved. I would never in my life buy premium service from a company that so blatantly ignores problems in its own most important child. I totally understand why react-native or flutter is considered better and more developers work with it

I am seeing the same issue as well. The only workaround I found was setting the initial screen to a static background color and not showing the splash image.

<style name="AppTheme.NoActionBarLaunch" parent="AppTheme.NoActionBar">
    <item name="android:statusBarColor">#000000</item>
    <item name="android:navigationBarColor">#000000</item>
    <item name="android:background">#000000</item>
</style>

The drawback is that you get a blank screen without an image for about a second. If anyone has a better workaround let me know.

The above workaround does not work with the barcode scanner plugin which require transparent background.
My workaround (the drawback with blank white screen still exist there but it work):

    <style name="AppTheme.NoActionBar" parent="Theme.AppCompat.NoActionBar">
        <item name="android:windowActionBar">false</item>
        <item name="android:windowNoTitle">true</item>
        <item name="android:windowBackground">@android:color/white</item>
    </style>
    <style name="AppTheme.NoActionBarLaunch" parent="AppTheme.NoActionBar"></style>

@bitflower
Copy link

@Pacjonek Opensource works the other way round: be grateful for what you got not be thankless for what you didn‘t get.

@Pacjonek

This comment has been minimized.

@danielehrhardt
Copy link

@bitflower I'm not talking about a project of a one/few developers working on an extra project after hours. I'm talking about the main project of a not-so-small corporation that willingly undertook to create its own version of Cordova because they found that it is not good enough.
And then they stopped fixing bugs... for years
EOT.

Hire a professional developer. Let's fix him this and then make a pull request.

@mlynch
Copy link
Contributor

mlynch commented Jan 4, 2022

@Pacjonek We actively work on and maintain Capacitor, so I'm not sure what you're talking about. Clearly the workarounds in this issue aren't sufficient for people in here but this is a tricky one to get right. We'll take a look.

@jfcere
Copy link

jfcere commented Jan 17, 2022

I just want to share the two options I found through this post that, to me, seem to be the better alternatives...

@peterpeterparker solution works well! The result is that you get a plain background with the desired color for 1-2 seconds before your splash screen kicks in but still acceptable as it is smooth.

@enginkarabel solution works as we expect the plugin to behave! This fixes the bad resizing that squeezes the splash screen for 1-2 seconds but requires a "little" more work (believe me it's pretty easy).

UPDATE 2022-02-09

The proposed @enginkarabel solution is not working with Android 12. In fact... even with Android 11 and lower it was giving a warning in the console that @drawable/custom_splash was not found and it seems like it was forcing the splash screen to be shown earlier with correct cropping. In Android 12 the warning is now an error and just makes the application hang on.

I had to fall back to @peterpeterparker solution but I don't have the smooth fade-in transition as he does... I assume that this is because he is using the SplashScreen.show method with the fadeInDuration option but in my case, I don't want to wait for Angular to bootstrap to be able to display the splash screen! So... yeah not really a nice solution in the end :(

@insel-maz
Copy link

We also have crashes with Samsung Galaxy S20 / Android 12.

Because we only use one icon and one background color, I switched to (in addition to #1627 (comment)):

capacitor.config.ts

plugins: {
	SplashScreen: {
		launchAutoHide: false,
		androidSplashResourceName: 'custom_splash',
	},
},

custom_splash.xml

<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
	<item android:drawable="@color/ic_launcher_background"/>
	<item>
		<bitmap android:src="@drawable/splash_icon" android:gravity="center"/>
	</item>
</layer-list>

@bhandaribhumin
Copy link

This fix is resolve my issue:

Screenshot 2022-04-29 at 8 05 38 PM

@timvanuum
Copy link

Hi, having the same issue and digged on Ionic Forums and find the following. Just appying as follows it did the job for me, without setting up a color as @peterpeterparker said (it also works but this seems to do the trick on a better way). Check it out.

<style name="AppTheme.NoActionBarLaunch" parent="AppTheme.NoActionBar"> <item name="android:windowNoTitle">true</item> <item name="android:windowActionBar">false</item> <item name="android:windowFullscreen">true</item> <item name="android:windowContentOverlay">@null</item> <item name="android:windowIsTranslucent">true</item> </style>

By the way, i also agree such a simple thing to be so frustating. Maybe not the worst issue on an app but, if all customers have a similarity all around the world is for putting their eyes in such little things - just opening the app - before all the incredible effort behind the scenes.

Regards.

It works, but makes startup very slow, a second delay. Using a background color for now. But hoping for a real solution.

@ionitron-bot
Copy link

ionitron-bot bot commented Nov 10, 2022

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Capacitor, please create a new issue and ensure the template is fully filled out.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Nov 10, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests