ionic cordova platform add android re-adds deprecated <splash> tags

Abierto
#5,130 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
56/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
typescript
Área
cli

Línea de trabajo

Comienza con el flujo ionic cordova platform add android en la Ionic CLI y sigue su integración con la generación de recursos, especialmente cordova-res 0.15.4; compáralo con cordova platform add android directamente. Se considera terminado cuando añadir Android ya no restaure entradas <splash> obsoletas cuando las preferencias modernas de splash ya estén presentes.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

triage

Description

When using Ionic CLI with a recent version of cordova-android, running:

ionic cordova platform add android

automatically re-adds deprecated <splash> entries to config.xml.

These tags are no longer supported by recent versions of cordova-android and cause the following warning/error during build:

The "<splash>" tags were detected and are no longer supported.
Please migrate to the "preference" tag "AndroidWindowSplashScreenAnimatedIcon".

The issue does not occur when adding the Android platform directly with Cordova CLI.

Environment

Ionic CLI                     : 7.2.1
Ionic Framework               : @ionic/angular 9.0.1
@angular-devkit/build-angular : 22.1.6
@angular-devkit/schematics    : 22.1.6
@angular/cli                  : 22.1.6
@ionic/angular-toolkit        : 13.0.0

Cordova CLI       : 13.0.0
Cordova Platforms : android 15.1.0
cordova-res        : 0.15.4

NodeJS : v24.20.0
npm    : 11.19.0
OS     : Windows 10

Steps to reproduce

  1. Remove the Android platform:
ionic cordova platform rm android
  1. Remove all legacy <splash> entries from config.xml.

The relevant part of the configuration contains only the new splash screen preferences:

<preference
    name="AndroidWindowSplashScreenBackground"
    value="#000000" />

<preference
    name="AndroidWindowSplashScreenAnimatedIcon"
    value="resources/android/splashscreen.xml" />
  1. Run:
ionic cordova platform add android
  1. Check config.xml.

The following entries are automatically added back:

<splash density="port-ldpi" src="resources/android/splash/drawable-port-ldpi-screen.png" />
<splash density="port-mdpi" src="resources/android/splash/drawable-port-mdpi-screen.png" />
<splash density="port-hdpi" src="resources/android/splash/drawable-port-hdpi-screen.png" />
<splash density="port-xhdpi" src="resources/android/splash/drawable-port-xhdpi-screen.png" />
<splash density="port-xxhdpi" src="resources/android/splash/drawable-port-xxhdpi-screen.png" />
<splash density="port-xxxhdpi" src="resources/android/splash/drawable-port-xxxhdpi-screen.png" />

Important comparison

If I repeat the same process but use Cordova CLI directly:

cordova platform rm android
cordova platform add android

the deprecated <splash> entries are NOT added back.

So the behavior appears to be specific to the Ionic CLI wrapper:

cordova platform add android
=> config.xml remains unchanged

ionic cordova platform add android
=> deprecated <splash> tags are added back

Expected behavior

ionic cordova platform add android should not add deprecated <splash> tags when using recent versions of cordova-android.

Ideally, it should preserve:

<preference
    name="AndroidWindowSplashScreenAnimatedIcon"
    value="resources/android/splashscreen.xml" />

without generating legacy splash screen entries.

Actual behavior

Ionic CLI re-adds legacy <splash> elements, even though they are unsupported by cordova-android 15.1.0.

Workaround

Using Cordova CLI directly avoids the problem:

cordova platform add android

After that, builds using:

ionic cordova build android

work correctly and do not re-add the <splash> entries.

Additional notes

This may be related to the Ionic CLI resource generation flow / cordova-res, since cordova-res 0.15.4 is used by the current Ionic CLI Cordova integration.

Lenguaje dominante
TypeScript
Estrellas
2k
Forks
681
Métricas de merge de PR
Sin PR fusionados en 30 d

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de ionic-team/ionic-cli

Todos los issues de ionic-team/ionic-cli

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.