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

更新Visual Studio 2022后MAUI应用安卓真机运行报错咨询

解决VS2022更新后MAUI安卓物理设备运行的Runtime Pack错误

更新Visual Studio 2022后,原有MAUI应用在安卓物理设备运行时出现以下错误,但新建MAUI应用可正常运行:

There was no runtime pack for Microsoft.Android available for the specified RuntimeIdentifier 'win-x64'
There was no runtime pack for Microsoft.Maui.Core available for the specified RuntimeIdentifier 'win-x64'
There was no runtime pack for Microsoft.Maui.Controls available for the specified RuntimeIdentifier 'win-x64'
There was no runtime pack for Microsoft.Essentials available for the specified RuntimeIdentifier 'win-x64'

可通过以下步骤排查解决:

  • 检查项目RuntimeIdentifier配置
    右键项目→属性→生成,确认目标框架对应的RuntimeIdentifier为安卓相关值(如android-arm64、android-x86_64),而非win-x64。也可直接编辑.csproj文件,修改<RuntimeIdentifiers>节点,示例:

    <RuntimeIdentifiers>android-arm64;android-x86_64</RuntimeIdentifiers>
    
  • 清理重建项目
    执行菜单「生成→清理解决方案」,手动删除项目目录下的bin和obj文件夹,再重新生成解决方案后尝试部署。

  • 统一NuGet包版本
    右键项目→管理NuGet程序包,确保所有Microsoft.Maui.*、Microsoft.Android.*、Microsoft.Essentials系列包的版本与VS2022更新后的MAUI SDK版本一致(可参考新建MAUI项目的包版本),更新后清理重建项目。

  • 重置VS相关组件
    打开VS安装器选择「修改」,确认已安装最新的.NET MAUI组件和Android SDK组件,完成更新后重启VS再尝试运行。

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.07.24 16:52:01