AndroidSupportComponents icon indicating copy to clipboard operation
AndroidSupportComponents copied to clipboard

Annotations task `VerifyVersionsTask` fails with dotnet build

Open pjcollins opened this issue 5 years ago • 1 comments

In our experiments with creating a Xamarin.Android MSBuild project SDK and testing our compatibility with dotnet build, we've ran into the following error in _VerifyXamarinAndroidSupportVersions:

Could not load file or assembly 'Microsoft.Build.Utilities.v4.0, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.

C:\Microsoft\Xamarin\NuGet\xamarin.android.support.annotations\28.0.0.3\build\monoandroid90\Xamarin.Android.Support.Annotations.targets(20,3): error MSB4062: The "Xamarin.Android.Support.BuildTasks.VerifyVersionsTask" task could not be loaded from the assembly C:\Microsoft\Xamarin\NuGet\xamarin.android.support.annotations\28.0.0.3\build\monoandroid90\Xamarin.Android.Support.BuildTasks.dll. Could not load file or assembly 'Microsoft.Build.Utilities.v4.0, Version=4.0.0.0, 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.

If we choose to address this I believe we'll need to switch the MSBuild references in this project over to NuGets, or do something similar to what xamarin-android is doing.

pjcollins avatar Jan 29 '20 18:01 pjcollins

We are facing this issue as well. Is there a workaround? Thanks!

l3ender avatar May 21 '23 22:05 l3ender