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

Azure DevOps Pipeline安卓构建报MSB4062错误,自托管代理执行失败

Azure DevOps自托管代理Android构建失败问题

报错信息

##[error]C:\Users$csadoeagent001.nuget\packages\mobile.buildtools\2.0.245\build\Mobile.BuildTools.targets(37,5): Error MSB4062: The "Mobile.BuildTools.Tasks.LocateBuildToolsConfigTask" task could not be loaded from the assembly C:\Users%24csadoeagent001.nuget\packages\mobile.buildtools\2.0.245\build\Mobile.BuildTools.dll. Could not load file or assembly 'file:///C:\Users%24csadoeagent001.nuget\packages\mobile.buildtools\2.0.245\build\Mobile.BuildTools.dll' or one of its dependencies. The system cannot find the file specified. Confirm that the declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask.

问题背景

该Android构建任务在本地环境及Azure托管代理(windows-2022、windows-latest)上均可正常执行。为配置SonarQube分析,将构建切换为使用自托管Windows代理后,在单元测试环节出现上述构建失败问题。

已尝试的解决方案(均未解决)

  • 升级NuGetToolInstaller任务:从NuGetToolInstaller@0升级至NuGetToolInstaller@1
  • 升级NuGet工具版本:从5.8.0升级至6.10.0
  • 升级.NET Core SDK版本:从7.0.306升级至8.0.205和8.0.206
  • 升级mobile.buildtools版本:从2.0.190-pre升级至2.0.245

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.06.23 03:58:19