maui中安卓端报错缺少文件appicon mipmap/appicon_round) not found

项目突然报错mipmap/appicon_round) not found

严重性	代码	说明	项目	文件	行	禁止显示状态
错误	APT2260	resource mipmap/appicon_round (aka com.companyname.todoreminderapp:mipmap/appicon_round) not found.

This error is likely caused by an issue with the AndroidManifest.xml file or an Android manifest generation attribute in a source code file.	TodoReminderApp	F:\Merchant\project\todotask\TodoReminderApp\TodoReminderApp\Platforms\Android\AndroidManifest.xml	1	
错误	APT2067	failed processing manifest.
	TodoReminderApp	C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.52\tools\Xamarin.Android.Aapt2.targets	214	
错误	APT2260	resource mipmap/appicon (aka com.companyname.todoreminderapp:mipmap/appicon) not found.

This error is likely caused by an issue with the AndroidManifest.xml file or an Android manifest generation attribute in a source code file.	TodoReminderApp	F:\Merchant\project\todotask\TodoReminderApp\TodoReminderApp\Platforms\Android\AndroidManifest.xml	1	

解决方法

# 清理后重新编译
dotnet clean
dotnet build

其他验证:清理缓存 + 重建

完成上述步骤后,按以下流程确保资源生效:

  1. 清理项目:右键项目 → 清理(删除 binobj 目录中的旧构建文件)。

  2. 重建项目:右键项目 → 生成(观察输出窗口,若 APT2260 错误消失,说明资源已被识别)。

  3. 运行测试:若构建成功,启动 Android 模拟器 / 真机,确认应用图标能正常显示(无默认占位图标)

  4. 删除 obj 目录中的缓存资源: 手动删除 obj/Debug/net8.0-android/res 目录(Android 资源编译缓存),再重新构建,避免旧缓存干扰。

  5. 清理 (Clean Solution)。

  6. 删除 binobj 文件夹。

  7. 重启 Visual Studio。

  8. 重新生成 (Rebuild Solution)。

  9. 彻底清理并重新生成 (最重要!)

    这是解决此问题的最关键步骤。旧的构建缓存 (binobj) 可能包含了错误的状态。