ionic-team / ionic-team/ionic-cli

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

Aperta
#5,130 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
triage
Lingua principale
TypeScript
Stelle
2k
Fork
682
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

## Description

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

```bash
ionic cordova platform add android
```

automatically re-adds deprecated `` entries to `config.xml`.

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

```text
The "" 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

```text
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:

```bash
ionic cordova platform rm android
```

2. Remove all legacy `` entries from `config.xml`.

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

```xml

```

3. Run:

```bash
ionic cordova platform add android
```

4. Check `config.xml`.

The following entries are automatically added back:

```xml

```

## Important comparison

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

```bash
cordova platform rm android
cordova platform add android
```

the deprecated `` entries are NOT added back.

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

```text
cordova platform add android
=> config.xml remains unchanged

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

## Expected behavior

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

Ideally, it should preserve:

```xml

```

without generating legacy splash screen entries.

## Actual behavior

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

## Workaround

Using Cordova CLI directly avoids the problem:

```bash
cordova platform add android
```

After that, builds using:

```bash
ionic cordova build android
```

work correctly and do not re-add the `` 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.

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Start with the `ionic cordova platform add android` flow in the Ionic CLI and trace its resource-generation integration, especially `cordova-res 0.15.4`; compare it with direct `cordova platform add android`. Done means adding Android no longer restores deprecated `` entries when the modern splash preferences are already present.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
typescript
Ambito
cli
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Attiva
Chiarezza
Abbastanza chiara
Idoneità per principianti
56/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.