ionic cordova platform add android re-adds deprecated <splash> tags
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 56/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- typescript
- 领域
- cli
调研方向
从 Ionic CLI 中的 ionic cordova platform add android 流程开始,跟踪其资源生成集成,尤其是 cordova-res 0.15.4;将其与直接执行 cordova platform add android 进行比较。当现代 splash 偏好设置已经存在时,添加 Android 不再恢复已弃用的 <splash> 条目,即表示完成。
由索引模型根据 Issue 内容生成。
描述
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
- Remove the Android platform:
ionic cordova platform rm android
- Remove all legacy
<splash>entries fromconfig.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" />
- Run:
ionic cordova platform add android
- 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.
- 主要语言
- TypeScript
- 星标
- 2k
- 派生
- 681
- PR 合并指标
- 30 天内没有已合并 PR
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
ionic-team/ionic-cli 的其他 Issue
-
triage
难度 1/5 1 小时以内 新手友好度 65/100
ionic-team/ionic-cli#5016 ·
-
triage
难度 5/5 一周以上 新手友好度 15/100
ionic-team/ionic-cli#5131 ·
-
triage
难度 3/5 1-2 天 新手友好度 72/100
ionic-team/ionic-cli#5129 ·
-
triage
难度 3/5 1-2 天 新手友好度 42/100
ionic-team/ionic-cli#5127 · 2 条评论 ·
-
triage
难度 2/5 1-3 小时 新手友好度 25/100
ionic-team/ionic-cli#5124 ·
查看 ionic-team/ionic-cli 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
bug clawsweeper:linked-pr-open clawsweeper:needs-live-repro clawsweeper:no-new-fix-pr impact:message-loss issue-rating: 🐚 platinum hermit P2 regression
难度 2/5 1-3 小时 新手友好度 78/100
-
enhancement
难度 2/5 1-3 小时 新手友好度 68/100
-
calcite-components needs triage refactor
难度 2/5 1-3 小时 新手友好度 75/100
Esri/calcite-design-system#15203 ·
-
难度 2/5 1-3 小时 新手友好度 90/100
danielmiessler/LifeOS#2218 ·