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 icon not show at first launch #1701

Open
2 of 3 tasks
campagna91 opened this issue Apr 5, 2024 · 3 comments
Open
2 of 3 tasks

Splash screen icon not show at first launch #1701

campagna91 opened this issue Apr 5, 2024 · 3 comments

Comments

@campagna91
Copy link

campagna91 commented Apr 5, 2024

Bug Report

Problem

What is expected to happen?

Icon should be visible at each start up.

What does actually happen?

The splash screens show only the background color specified in the config.xml but not the drawable vector icon. This scenario occurs only the FIRST time (after the installation). Once the app is being opened once, after having close it, the icon is showed at each opening.

Information

Here below my config.xml

`

<!-- General Info -->

<name>APP_NAME</name>
<description>An app for booking from COMPANY S.r.l.</description>
<author email="[email protected]" href="https://www.company.com/">Contact us</author>
<content src="index.html" />

<!-- Platforms Target -->

<engine name="android" spec="12.0.1"/>
<engine name="ios" spec="7.0.1" />

<!-- Permissions -->

<access origin="*"/>
<allow-intent href="sms:*" />
<allow-intent href="tel:*" />
<allow-intent href="geo:*" />
<allow-intent href="mailto:*" />
<allow-intent href="file://*/*" />
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />
<allow-navigation href="http://*/*" />
<allow-navigation href="https://*/*" />

<!-- SCHEME and DOMAIN  -->

<preference name="scheme" value="ionic" />
<preference name="hostname" value="localhost" />
<preference name="Scheme" value="ionic" />
<preference name="iosScheme" value="ionic" />
<preference name="Hostname" value="localhost" />
<preference name="WKPort" value="" />

<!-- Preferences -->

<preference name="webviewbounce" value="false" />
<preference name="KeyboardResize" value="false" />
<preference name="BackupWebStorage" value="none" />
<preference name="DisallowOverscroll" value="true" />
<preference name="StatusBarStyle" value="lightcontent" />
<preference name="StatusBarOverlaysWebView" value="false" />
<preference name="KeyboardDisplayRequiresUserAction" value="false"/>

<!-- Splash screen -->
<preference name="AutoHideSplashScreen" value="true" />
<preference name="ShowSplashScreenSpinner" value="false" />
<preference name="FadeSplashScreenDuration" value="400" />
<preference name="SplashScreenDelay" value="3000" />

<!-- Hooks -->

<hook src="www/hooks/fwk-after-prepare-hooks.js" type="after_prepare" />
<hook src="www/hooks/fwk-after-plugin-add-hooks.js" type="after_plugin_add" />
<hook src="www/hooks/fwk-after-prepare-copy-build-extra-hooks.js" type="after_prepare" />
<hook src="www/hooks/fwk-after-compile-hooks.js" type="after_compile" />
<hook src="www/hooks/fwk-before-build-hooks.js" type="before_build" />

<!-- Android -->

<platform name="android">

    <preference name="AndroidXEnabled" value="true" />

    <!-- SDK version -->
    <preference name="android-minSdkVersion" value="22" />
    <preference name="android-maxSdkVersion" value="34" />
    <preference name="android-targetSdkVersion" value="34" />

    <!-- Splashscreens -->
    <preference name="AndroidWindowSplashScreenAnimatedIcon" value="www/res/icon/app/icon.xml" />
    <resource-file src="www/res/assets/colors.xml" target="/app/src/main/res/values/colors.xml" />
    <icon background="@color/background" density="ldpi" foreground="www/res/icon/app/icon.xml" src="www/res/icon/app/icon-ldpi.png" />
    <icon background="@color/background" density="mdpi" foreground="www/res/icon/app/icon.xml" src="www/res/icon/app/icon-mdpi.png" />
    <icon background="@color/background" density="hdpi" foreground="www/res/icon/app/icon.xml" src="www/res/icon/app/icon-hdpi.png" />
    <icon background="@color/background" density="xhdpi" foreground="www/res/icon/app/icon.xml" src="www/res/icon/app/icon-xhdpi.png" />
    <icon background="@color/background" density="xxhdpi" foreground="www/res/icon/app/icon.xml" src="www/res/icon/app/icon-xxhdpi.png" />
    <icon background="@color/background" density="xxxhdpi" foreground="www/res/icon/app/icon.xml" src="www/res/icon/app/icon-xxxhdpi.png" />

    <!-- Push Configurations -->
    <!-- Don't remove the below line! -->
    <!-- Don't modify this resources-file list because it's generate-->
	<resource-file src="www/res/configurations/push/google-services.json" target="/app/src/debug/google-services.json" />
	<resource-file src="www/res/configurations/push/google-services.json" target="/app/src/release/google-services.json" />

    <!-- Push Icons -->
    <resource-file src="www/res/icon/push/mipmap-mdpi/ic_notification.png" target="app/src/main/res/mipmap-mdpi/ic_notification.png" />
    <resource-file src="www/res/icon/push/mipmap-hdpi/ic_notification.png" target="app/src/main/res/mipmap-hdpi/ic_notification.png" />
    <resource-file src="www/res/icon/push/mipmap-xhdpi/ic_notification.png" target="app/src/main/res/mipmap-xhdpi/ic_notification.png" />
    <resource-file src="www/res/icon/push/mipmap-xxhdpi/ic_notification.png" target="app/src/main/res/mipmap-xxhdpi/ic_notification.png" />
    <resource-file src="www/res/icon/push/mipmap-xxxhdpi/ic_notification.png" target="app/src/main/res/mipmap-xxxhdpi/ic_notification.png" />

    <!-- Allow Extenal Storage capacity -->
    <!-- Allow older android to choose photos from Gallery -->
    <edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application">
        <application android:requestLegacyExternalStorage="true"/>
    </edit-config>

    <config-file target="AndroidManifest.xml" parent="/manifest">
        <uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>
    </config-file>

</platform>

<!-- iOS -->

<platform name="ios">
    <!-- CORS -->

    <!-- From cordova-ios 6.x doc. -->
    <preference name="scheme" value="ionic" />
    <preference name="hostname" value="localhost" />

    <!-- From cordova-plugin-ionic-migrate-storage github -->
    <preference name="Scheme" value="ionic" />
    <preference name="iosScheme" value="ionic" />
    <preference name="Hostname" value="localhost" />
    <preference name="WKPort" value="" />

    <!-- Storage Porting -->
    <!-- From 'file__0.localstorage' format to 'app_localhost_0.localstorage' -->
    <preference name="MIGRATE_STORAGE_ORIGINAL_SCHEME" value="file" />
    <preference name="MIGRATE_STORAGE_ORIGINAL_HOSTNAME" value="" />
    <preference name="MIGRATE_STORAGE_ORIGINAL_PORT_NUMBER" value="0" />

    <!-- Push Firebase -->
    <resource-file src="www/res/configurations/push/GoogleService-Info.plist" />

    <!-- Resouces -->
    <icon height="20" src="www/res/icon/app/Icon-20.png" width="20" />
    <icon height="48" src="www/res/icon/app/[email protected]" width="48" />
    <icon height="55" src="www/res/icon/app/[email protected]" width="55" />
    <icon height="88" src="www/res/icon/app/[email protected]" width="88" />
    <icon height="172" src="www/res/icon/app/[email protected]" width="172" />
    <icon height="196" src="www/res/icon/app/[email protected]" width="196" />
    <icon height="29" src="www/res/icon/app/Icon-Small.png" width="29" />
    <icon height="40" src="www/res/icon/app/Icon-Small-40.png" width="40" />
    <icon height="40" src="www/res/icon/app/[email protected]" width="40" />
    <icon height="40" src="www/res/icon/app/[email protected]" width="40" />
    <icon height="50" src="www/res/icon/app/Icon-50.png" width="50" />
    <icon height="57" src="www/res/icon/app/Icon.png" width="57" />
    <icon height="58" src="www/res/icon/app/[email protected]" width="58" />
    <icon height="60" src="www/res/icon/app/[email protected]" width="60" />
    <icon height="58" src="www/res/icon/app/[email protected]" width="58" />
    <icon height="72" src="www/res/icon/app/Icon-72.png" width="72" />
    <icon height="76" src="www/res/icon/app/Icon-76.png" width="76" />
    <icon height="80" src="www/res/icon/app/[email protected]" width="80" />
    <icon height="80" src="www/res/icon/app/[email protected]" width="80" />
    <icon height="80" src="www/res/icon/app/[email protected]" width="80" />
    <icon height="87" src="www/res/icon/app/[email protected]" width="87" />
    <icon height="87" src="www/res/icon/app/[email protected]" width="87" />
    <icon height="100" src="www/res/icon/app/[email protected]" width="100" />
    <icon height="114" src="www/res/icon/app/[email protected]" width="114" />
    <icon height="120" src="www/res/icon/app/[email protected]" width="120" />
    <icon height="120" src="www/res/icon/app/[email protected]" width="120" />
    <icon height="144" src="www/res/icon/app/[email protected]" width="144" />
    <icon height="152" src="www/res/icon/app/[email protected]" width="152" />
    <icon height="167" src="www/res/icon/app/[email protected]" width="167" />
    <icon height="180" src="www/res/icon/app/[email protected]" width="180" />
    <icon height="1024" src="www/res/icon/app/icon-1024.png" width="1024" />

    <splash src="www/res/splashscreen/Default@2x~universal~anyany.png"/>

</platform>

<!-- PLUGINS LIST -->
<!-- DONT ERASE LINE BELOW -->
<!-- Don't modify this plugins list because it's generate-->
<plugin name="cordova-plugin-app-version" spec="0.1.9"/>
<plugin name="cordova-plugin-calendar" spec="5.1.6"/>
<plugin name="cordova-plugin-call-number" spec="1.0.1"/>
<plugin name="cordova-plugin-device" spec="1.1.7"/>
<plugin name="cordova-plugin-file" spec="6.0.2"/>
<plugin name="cordova-plugin-inappbrowser" spec="4.0.0"/>
<plugin name="cordova-plugin-ionic-keyboard" spec="2.2.0"/>
<plugin name="cordova-plugin-media-capture" spec="3.0.3">
	<variable name="PHOTOLIBRARY_USAGE_DESCRIPTION" value="Allow_the_app_to_access_your_photos" />
</plugin>
<plugin name="cordova-plugin-network-information" spec="1.3.4"/>
<plugin name="cordova-plugin-statusbar" spec="2.4.3"/>
<plugin name="cordova.plugins.diagnostic" spec="6.1.0"/>
<plugin name="cordova-plugin-fbsdk" spec="4.0.2">
	<variable name="APP_ID" value="XXXXXXXXXXXXXXX" />
	<variable name="APP_NAME" value="com.company.APP_NAME" />
	<variable name="CLIENT_TOKEN" value="XXXXXXXXXXXXXXX" />
</plugin>
<plugin name="@havesource/cordova-plugin-push" spec="4.0.0"/>
<plugin name="cordova-plugin-camera" spec="6.0.0">
	<variable name="CAMERA_USAGE_DESCRIPTION" value="Allow_the_app_to_use_your_camera" />
	<variable name="PHOTOLIBRARY_USAGE_DESCRIPTION" value="Allow_the_app_to_access_your_photos" />
</plugin>

`

Command or Code

If can help, deploying directly from the Android studio (using version Iguana | 2023.2.1 Patch) the icon splash screen works like a sharm - so no issue. The problem appear only after having build the app and publish to our OTA (with same code obviously).

Environment, Platform, Device

i'm using for test purpose:

  • Google Pixel 8 with Android 14 (test KO)
  • Google Pixel 5 with Android 13 (test KO)
  • Huawei P40 Lite with Emui 12.0.0 (test OK)
  • iPhone X with iOS 16.1 (test OK)

Version information

  • cordova 10.0.0
  • cordova-android 12.0.1
  • cordova-ios 7.0.1

Checklist

@breautek
Copy link
Contributor

breautek commented Apr 5, 2024

I would suggest raising the issue on google's issue tracker if you're encountering on Android 13 or later. Maybe it's a regression. Be prepared to provide a sample application.

This was a known issue for Android 12 or any earlier version which used the compatibility library and was supposedly fixed in Android 13 based on a google issue ticket which I can no longer find.

The splashscreen is entirely powered by Android SDK now, so I don't think there is anything that Cordova can do.

@egonzalez-handtevy
Copy link

@campagna91 did you find a solution or workaround for this? 🙏

@gmoneyman
Copy link

I have same issue in Android 13. Anything from anyone?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants