如何解决ic_launcher(com.live.plive:mipmap/ic_launcher)资源找不到问题
Android Studio打包APK/Bundle失败:图标资源找不到错误
原本正常运行的应用,修改图标后无论如何操作都无法生成APK或Bundle,使用的是最新版本的Android Studio,已搜索过相关解决方案均无效。
已执行操作
- 连续3天在平台及谷歌搜索解决方案
- 通过「File」→「mipmap」→「app」路径添加新图像资源
- 删除mipmap目录所有文件后重试打包
- 复制新项目Manifest的Application配置并替换为自身项目信息
注:未编辑Release Manifest,以下仅展示报错相关内容。
报错日志
Android resource linking failed W:\Live6\app\build\intermediates\packaged_manifests\release\AndroidManifest.xml:13: error: resource mipmap/ic_launcher (aka com.live.plive:mipmap/ic_launcher) not found. W:\Live6\app\build\intermediates\packaged_manifests\release\AndroidManifest.xml:13: error: resource mipmap/ic_launcher_round (aka com.live.plive:mipmap/ic_launcher_round) not found. error: failed processing manifest.
Release Manifest报错相关代码
<application android:allowBackup="true" android:appComponentFactory="androidx.core.app.CoreComponentFactory" android:dataExtractionRules="@xml/data_extraction_rules" android:fullBackupContent="@xml/backup_rules" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" android:theme="@style/Theme.pLive" >
该配置与主Manifest一致。
注:mipmap目录中存在ic_launcher、ic_launcher_foreground和ic_launcher_round文件。
主Manifest配置
<application tools:replace="android:icon" android:allowBackup="true" android:dataExtractionRules="@xml/data_extraction_rules" android:fullBackupContent="@xml/backup_rules" android:icon="@mipmap/ic_launcher" android:roundIcon="@mipmap/ic_launcher_round" android:label="@string/app_name" android:supportsRtl="true" android:theme="@style/Theme.pLive" tools:targetApi="s">
内容的提问来源于stack exchange,提问作者Christopher Robbins
相关产品推荐
相关产品推荐

