Azure devops pipeline Android build is failing with the error
##[error]C:Users$csadoeagent001.nugetpackagesmobile.buildtools2.0.245buildMobile.BuildTools.targets(37,5): Error MSB4062: The “Mobile.BuildTools.Tasks.LocateBuildToolsConfigTask” task could not be loaded from the assembly C:Users%24csadoeagent001.nugetpackagesmobile.buildtools2.0.245buildMobile.BuildTools.dll. Could not load file or assembly ‘file:///C:Users%24csadoeagent001.nugetpackagesmobile.buildtools2.0.245buildMobile.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.
This works fine in local and also works when I use azure hosted agents (windows-2022 and windows-latest). I’m trying to configure Sonarqube to this build hence I have updated the build to use self hosted windows agent. It is failing while building the unit tests.
I tried updating the NuGetToolInstaller@0 to NuGetToolInstaller@1, and updating the nuget tool version to 5.8.0 to 6.10.0, updated the .net core sdk from 7.0.306 to 8.0.205 and 8.0.206, updated the mobile.buildtools version 2.0.190-pre to 2.0.245. No change in the error
Seema Khan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.