You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

React Native Android端如何正确配置应用图标 解决最小化显示默认图标问题

安卓最近任务栏应用图标显示异常解决方案

问题根源

Android 8.0(API 26)及以上版本系统中,最近任务栏的应用图标优先读取roundIcon属性或自适应图标配置,主屏幕图标因为兼容旧版规范所以显示正常,因此会出现两端显示不一致的问题。

修复步骤

  • 第一步:修改AndroidManifest.xml配置
    打开android/app/src/main/AndroidManifest.xml文件,定位到application节点,确保同时配置了android:icon和android:roundIcon两个属性,指向你自定义的图标资源:
    <application
        android:name=".MainApplication"
        android:icon="@mipmap/ic_launcher"
        android:roundIcon="@mipmap/ic_launcher_round"
        <!-- 其余原有配置保持不变 -->
    >
    
  • 第二步:补全图标资源
    检查android/app/src/main/res/下的所有mipmap文件夹:

    各dpi对应的mipmap-mdpi、mipmap-hdpi、mipmap-xhdpi、mipmap-xxhdpi、mipmap-xxxhdpi目录下,必须同时存在ic_launcher.png和ic_launcher_round.png两套图标文件
    如果项目使用了自适应图标,还需要确认res/mipmap-anydpi-v26目录下的ic_launcher.xml和ic_launcher_round.xml中配置的前景、背景图片资源路径正确

  • 第三步:重新打包生效
    1. 运行./gradlew clean命令清理构建缓存
    2. 完全卸载测试设备上的原有应用
    3. 重新编译安装应用即可

问题参考截图

主屏幕正常显示的应用图标
最小化后显示的默认应用图标
图标存放路径示例

内容的提问来源于stack exchange,提问作者Joshi G

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.09.28 20:36:03