xamarin / app-crm

MIT License
387 stars 249 forks source link

Build error on VSO #110

Open twilly86 opened 7 years ago

twilly86 commented 7 years ago

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]

mschulz531 commented 7 years ago

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.

mschulz531 commented 7 years ago

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!