三星One UI 2.5下Ionic应用图标显示为方形的问题求助
问题:Ionic应用图标在Galaxy S9上显示为方形,其他应用均为圆形

所有应用图标均为圆形,为何我的Ionic应用图标显示为方形?目前尚无解决方案,恳请提供建议。
设备信息
- 设备型号:Galaxy S9
- 型号编号:SM-G960U
- One UI版本:2.5
- Android版本:10
开发环境
Ionic: Ionic CLI : 6.19.0 (C:\Users\Avirup Ghosh\AppData\Roaming\npm\node_modules\@ionic\cli) Ionic Framework : @ionic/angular 5.9.4 @angular-devkit/build-angular : 0.901.15 @angular-devkit/schematics : 9.1.15 @angular/cli : 9.1.15 @ionic/angular-toolkit : 2.3.3 Cordova: Cordova CLI : 10.0.0 (cordova-lib@10.1.0) Cordova Platforms : android 10.1.2 Cordova Plugins : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 4.2.1, (and 22 other plugins) Utility: cordova-res : 0.15.4 native-run (update available: 1.7.1) : 1.5.0 System: Android SDK Tools : 26.1.1 (C:\Users\Avirup Ghosh\AppData\Local\Android\Sdk) NodeJS : v16.14.2 (C:\Program Files\nodejs\node.exe) npm : 6.14.16 OS : Windows 10
解决方案建议
1. 配置Android自适应图标
Android 8.0+强制使用自适应图标,Ionic/Cordova项目需按规范配置:
- 在
resources/android/icon目录下添加foreground.png(1024x1024px,透明背景,图标内容集中在中间72%区域)和background.png(1024x1024px,纯色或渐变背景) - 运行
cordova-res android --icon自动生成全尺寸适配资源 - 确认
config.xml中包含自适应图标配置:
<platform name="android"> <resource-file src="resources/android/icon/foreground.png" target="res/mipmap-anydpi-v26/ic_launcher_foreground.png" /> <resource-file src="resources/android/icon/background.png" target="res/mipmap-anydpi-v26/ic_launcher_background.png" /> </platform>
2. 清理重建项目
- 执行
ionic cordova clean android清除旧构建缓存 - 重新构建生产包:
ionic cordova build android --prod - 卸载设备上的旧版本应用后重新安装
3. 检查设备启动器设置
三星One UI支持自定义图标形状,前往:设置 > 显示 > 主屏幕 > 图标形状,确认设置为默认的圆形/自适应模式
内容的提问来源于stack exchange,提问作者Avirup Ghosh
相关产品推荐
相关产品推荐

