How to fix Error MSB4062: The "Xamarin.Android.Support.Tasks.VectorDrawableCheckBuildToolsVersionTask"

Jamal 0 Reputation points

Hi everyone,

I am currently working on migrating our Xamarin.Forms project into .Net MAUI. I created new MAUI App project and I was able to build and run that project in both platforms(Android & iOS). after that I have copied Android platform specific codes from older Xamarin Forms Android project and pasted the code into MAUI project Platform/Android directory. While running the project in Android device I am getting below error

/Users/jamal/.nuget/packages/,3): Error MSB4062: The "Xamarin.Android.Support.Tasks.VectorDrawableCheckBuildToolsVersionTask" task could not be loaded from the assembly /Users/jamal/.nuget/packages/ Could not load file or assembly 'Microsoft.Build.Utilities.v4.0, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.

Confirm that the <UsingTask> 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. (MSB4062) (MigrationProject)

I have tried few workarounds like cleaning the bin and obj directory, restarting the visual Studio for Mac and restarting Mac machine but these couldn't help to resolve the above built issue.

A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
2,606 questions
{count} votes