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

迁移至.NET 7.0 MAUI的Xamarin.Forms iOS应用图标部署后不显示

MAUI iOS迁移后图标不显示的解决方法
  • 修正路径拼写错误:你的配置中存在拼写错误——AppIcon.appiocnset应为AppIcon.appiconset(注意是icons而非iocn),需同时修改csproj和Info.plist中的路径。

  • 规范MAUI图标配置:MAUI无需手动在csproj中添加<ImageAsset>节点,重点确保Assets.xcassets/AppIcon.appiconset目录下的Contents.json配置正确,需包含iOS要求的所有图标尺寸、缩放比和对应文件名,示例配置如下:

    {
      "images": [
        {
          "idiom": "iphone",
          "size": "20x20",
          "scale": "2x",
          "filename": "icon20@2x.png"
        },
        {
          "idiom": "iphone",
          "size": "20x20",
          "scale": "3x",
          "filename": "icon20@3x.png"
        },
        {
          "idiom": "iphone",
          "size": "29x29",
          "scale": "2x",
          "filename": "icon29@2x.png"
        },
        // 补充其他所有必要尺寸的配置...
      ],
      "info": {
        "version": 1,
        "author": "xcode"
      }
    }
    
  • 清理重建项目:

    • 删除iOS项目的bin和obj目录
    • 执行命令清理NuGet缓存:dotnet nuget locals all --clear
    • 重新生成解决方案后再部署
  • 检查文件属性:

    • 确认Info.plist的Build Action为BundleResource
    • 所有图标文件的Build Action设置为BundleResource,复制到输出目录选项设为如果较新则复制
  • 清除设备/模拟器缓存:

    • 模拟器:通过Simulator菜单选择Reset Content and Settings...重置
    • 真机:删除应用后重新安装部署

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.07.08 09:27:46