xamarin/app-crm

Build error on VSO

Opened this issue · 2 comments

I added this sample project to my git repository and setup a xamarin android build on VSO. I'm using the hosted build agent and getting the following error...

2016-10-17T16:45:06.0399969Z C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1616,5): error MSB4018: The "LinkAssemblies" task failed unexpectedly. [C:\a\1\s\XamarinCRM.Android\XamarinCRM.Android.csproj]
2016-10-17T16:45:06.0399969Z C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1616,5): error MSB4018: Xamarin.Android.XamarinAndroidException: error XA2006: Reference to metadata item 'Mono.Security.Cryptography.SymmetricTransform' (defined in 'System.Core, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e') from 'System.Core, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e' could not be resolved. ---> Mono.Cecil.ResolutionException: Failed to resolve Mono.Security.Cryptography.SymmetricTransform [C:\a\1\s\XamarinCRM.Android\XamarinCRM.Android.csproj]
2016-10-17T16:45:06.0399969Z C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1616,5): error MSB4018: at Mono.Linker.Steps.MarkStep.MarkType(TypeReference reference) [C:\a\1\s\XamarinCRM.Android\XamarinCRM.Android.csproj]

I'm getting this same error and it is driving me nuts trying to find a solution. The app builds just fine in debug and release mode on my local machine, and builds in debug mode on VSTS, but building in release mode causes this error.

WOOT! I just solved this problem!
On the Droid project properties page in the solution in VS2015, the "Compile using Android Version" was set to Android 7. I changed the "Compile using" value to Android 6. I did not change the minimum android to target nor the target android version (which are set to 4.0.3 and 6.0, respectively).
Once I checked in this change to the MyApp.Droid.csproj file, the CI build kicked in and for the first time it completed without the linker error!
I also confirmed that after this change, the debug and release versions of the app still build on my local machine without issue!