When we are trying to build a xamarin forms project in release mode, we are getting the error:
C:\\Program Files (x86)\\MSBuild\\Xamarin\\Android\\Xamarin.An
I had a different root cause for the "LinkAssembliesTask failed" error.
I was upgrading NuGet packages, and messed up the references.
=====
Let's say I had two projects:
NetStandardProject
Has a reference to Assembly1.
Assembly1 has a class of CoolGuy, with a CoolGuy.Flex() method.
AndroidProject, which references NetStandardProject.
Has a reference to Assembly2.
Assembly2 has a class of CoolGuy, but no CoolGuy.Flex() method.
The linker was pulling in Assembly2, looking for CoolGuy.Flex(), then blew up with "LinkAssembliesTask failed", stating that it couldn't find the Flex() method. It couldn't because it was looking in the wrong assembly.
The NetStandard project compiled, because it was referencing Assembly1, and didn't really care what AndroidProject was referencing. It's built independently. But when the linker loaded Assembly2, it was using the "wrong" assembly.
I ended up sorta lucking out, and realized that one of the assemblies was unused, so I removed it, and the build succeeded.
Hope that helps someone down the line.
=====
Bonus: If you want to see which assembly it's choosing to search, let the build fail, then go to the {project}\obj{profile}{android_version}\android\assets folder, and find the dll. You will likely be able to verify that it's not there, and give you a starting point to understanding why it's failing.