We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Error MSB4018: The "LinkAssemblies" task failed unexpectedly

Hi,

Is there any advice on how to resolve the following build error, when setting the linker to Link SDK Assemblies.  This error does not occur when Linker is off.

C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(5,5): Error MSB4018: The "LinkAssemblies" task failed unexpectedly.
Xamarin.Android.XamarinAndroidException: error XA2006: Reference to metadata item 'System.Void Java.Interop.JavaTypeParametersAttribute::.ctor(System.String[])' (defined in 'Xamarin.Android.Support.v4, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null') from 'Xamarin.Android.Support.v4, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' could not be resolved. ---> Mono.Cecil.ResolutionException: Failed to resolve System.Void Java.Interop.JavaTypeParametersAttribute::.ctor(System.String[])
   at Mono.Linker.Steps.MarkStep.MarkMethod(MethodReference reference)
   at Mono.Linker.Steps.MarkStep.MarkCustomAttribute(CustomAttribute ca)
   at Mono.Linker.Steps.MarkStep.MarkCustomAttributes(ICustomAttributeProvider provider)
   at Mono.Linker.Steps.MarkStep.MarkType(TypeReference reference)
   at MonoDroid.Tuner.MonoDroidMarkStep.MarkType(TypeReference reference)
   at Mono.Linker.Steps.MarkStep.MarkType(TypeReference reference)
   at MonoDroid.Tuner.MonoDroidMarkStep.MarkType(TypeReference reference)
   at Mono.Linker.Steps.MarkStep.InitializeType(TypeDefinition type)
   at Mono.Linker.Steps.MarkStep.InitializeAssembly(AssemblyDefinition assembly)
   at Mono.Linker.Steps.MarkStep.Initialize()
   at Mono.Linker.Steps.MarkStep.Process(LinkContext context)
   at Mono.Linker.Pipeline.Process(LinkContext context)
   at MonoDroid.Tuner.Linker.Process(LinkerOptions options, LinkContext& context)
   at Xamarin.Android.Tasks.LinkAssemblies.Execute()
   --- End of inner exception stack trace ---
   at Xamarin.Android.Diagnostic.Error(Int32 code, Exception innerException, String message, Object[] args)
   at Xamarin.Android.Tasks.LinkAssemblies.Execute()
   at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
   at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__20.MoveNext() (MSB4018) (ParentLove.Android)


Thanks,
Ant

8 Replies

MK Magesh Kumar Krishnan Syncfusion Team January 7, 2016 11:26 AM UTC

Hi Anthony,

The reported error is not related to our control. Please refer to the following Xamarin.Forms forums to overcome this error

https://forums.xamarin.com/discussion/22358/building-release-version-for-android-failed  

https://forums.xamarin.com/discussion/17929/error-executing-task-linkassemblies-for-android-release-build
 
Regards,
Magesh Kumar K


AR Anthony Ramirez January 7, 2016 01:25 PM UTC

Thanks for the quick reply Magesh.  I'm looking into the posts now :)


AR Anthony Ramirez January 7, 2016 01:34 PM UTC

My first shot at it was not successful.

I also tried by downloading the SampleBrowser-Forms sln and get the same error. 

I'm using SyncFusion v 13.3.0.18

My Xamarin Env:
Xamarin Studio
Version 5.9.7 (build 22)
Installation UUID: 1d8a9232-d5d6-4d00-b378-e7d7d3ad6ebf
Runtime:
 Microsoft .NET 4.0.30319.34209
 GTK+ 2.24.22 (MS-Windows theme)
 GTK# 2.12.26
Xamarin.Android
Version: 5.1.7 (Business Edition)
Android SDK: C:\Users\Anthony\AppData\Local\Android\android-sdk
 Supported Android versions:
  2.3    (API level 10)
  4.0.3  (API level 15)
  4.1    (API level 16)
  4.2    (API level 17)
  4.3    (API level 18)
  4.4    (API level 19)
  4.4.87 (API level 20)
  5.0    (API level 21)
  5.1    (API level 22)
  6.0    (API level 23)
Java SDK: C:\Program Files (x86)\Java\jdk1.7.0_79
java version "1.7.0_79"
Java(TM) SE Runtime Environment (build 1.7.0_79-b15)
Java HotSpot(TM) Client VM (build 24.79-b02, mixed mode, sharing)
Xamarin Android Player
Version: 0.6.5
Location: P:\Program Files\Xamarin Android Player\DeviceManager.exe
Build Information
Release ID: 509070022
Git revision: 6bd1f169df44ca96addf8a035316c535a4fa46fa
Build date: 2015-09-30 10:13:51-04
Xamarin addins: 1c3e5c0859bdfec0ecd481a57ad6c03bc22f5536
Operating System
Windows 6.2.9200.0 (64-bit)

Error Details from SampleBrowser-Forms

Error 8 The "LinkAssemblies" task failed unexpectedly.
Xamarin.Android.XamarinAndroidException: error XA2006: Reference to metadata item 'System.Void Java.Interop.JavaTypeParametersAttribute::.ctor(System.String[])' (defined in 'Syncfusion.SfChart.Android, Version=13.3451.0.18, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89') from 'Syncfusion.SfChart.Android, Version=13.3451.0.18, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89' could not be resolved. ---> Mono.Cecil.ResolutionException: Failed to resolve System.Void Java.Interop.JavaTypeParametersAttribute::.ctor(System.String[])
   at Mono.Linker.Steps.MarkStep.MarkMethod(MethodReference reference)
   at Mono.Linker.Steps.MarkStep.MarkCustomAttribute(CustomAttribute ca)
   at Mono.Linker.Steps.MarkStep.MarkCustomAttributes(ICustomAttributeProvider provider)
   at Mono.Linker.Steps.MarkStep.MarkType(TypeReference reference)
   at MonoDroid.Tuner.MonoDroidMarkStep.MarkType(TypeReference reference)
   at Mono.Linker.Steps.MarkStep.InitializeType(TypeDefinition type)
   at Mono.Linker.Steps.MarkStep.InitializeAssembly(AssemblyDefinition assembly)
   at Mono.Linker.Steps.MarkStep.Initialize()
   at Mono.Linker.Steps.MarkStep.Process(LinkContext context)
   at Mono.Linker.Pipeline.Process(LinkContext context)
   at MonoDroid.Tuner.Linker.Process(LinkerOptions options, LinkContext& context)
   at Xamarin.Android.Tasks.LinkAssemblies.Execute()
   --- End of inner exception stack trace ---
   at Xamarin.Android.Diagnostic.Error(Int32 code, Exception innerException, String message, Object[] args)
   at Xamarin.Android.Tasks.LinkAssemblies.Execute()
   at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
   at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__20.MoveNext() C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets 1295 5 SampleBrowser.Droid


MK Magesh Kumar Krishnan Syncfusion Team January 8, 2016 03:03 PM UTC

Hi Anthony,

This issue is not related to our control. This issue occurs due to varius reasons. Anyone of the following process may be resolve your issue,

1. Reinstall the Xamarin nuget.
2. Update the Xamarin and Xamarin.Android to latest version.
3. Compile the app with latest Android sdk version (API 23).

Regards,
Magesh Kumar K


AR Anthony Ramirez January 16, 2016 10:13 PM UTC

Hi Magesh Kumar,

Just wanted to provide an update the upgrading to the latest Xamarin.Android resolve this issue.

Thanks so much for your quick assistance.

Best,
Ant


SB Suresh B Syncfusion Team January 18, 2016 09:03 AM UTC

Hi Anthony,

Thanks for your update.

We are glad to know that your issue had been resolved. Please get back to us if you need any other assistance. 
 
Regards,
Suresh B


S s April 15, 2019 06:33 AM UTC

Severity Code Description Project File Line Suppression State
Error The "LinkAssemblies" task failed unexpectedly.
Mono.Linker.MarkException: Error processing method: 'System.Boolean Syncfusion.SfPullToRefresh.XForms.SfPullToRefresh::RaisePullingEvent(System.Double)' in assembly: 'Syncfusion.SfPullToRefresh.XForms.dll' ---> Mono.Cecil.ResolutionException: Failed to resolve System.Void Syncfusion.Core.XForms.IPullToRefresh::Pulling(System.Double,System.Boolean&)
   at Mono.Linker.Steps.MarkStep.HandleUnresolvedMethod(MethodReference reference)
   at Mono.Linker.Steps.MarkStep.MarkMethod(MethodReference reference)
   at Mono.Linker.Steps.MarkStep.MarkInstruction(Instruction instruction)
   at Mono.Linker.Steps.MarkStep.MarkMethodBody(MethodBody body)
   at Mono.Linker.Steps.MarkStep.ProcessMethod(MethodDefinition method)
   at Mono.Linker.Steps.MarkStep.ProcessQueue()
   --- End of inner exception stack trace ---
   at Mono.Linker.Steps.MarkStep.ProcessQueue()
   at Mono.Linker.Steps.MarkStep.ProcessPrimaryQueue()
   at Mono.Linker.Steps.MarkStep.Process()
   at MonoDroid.Tuner.MonoDroidMarkStep.Process(LinkContext context)
   at Mono.Linker.Pipeline.Process(LinkContext context)
   at MonoDroid.Tuner.Linker.Process(LinkerOptions options, ILogger logger, LinkContext& context)
   at Xamarin.Android.Tasks.LinkAssemblies.Execute(DirectoryAssemblyResolver res)
   at Xamarin.Android.Tasks.LinkAssemblies.Execute()
   at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
   at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext() ETCrewReport.Droid



SP Subburaj Pandian Veluchamy Syncfusion Team April 15, 2019 01:50 PM UTC

Hi Anthony, 
 
Based on the provided information, we have checked the mentioned issue with PullToRefresh in Xamarin.Forms and we unable to replicate it from our end with link assemblies. Please find the following tested sample for your reference, 
 

Please check the sample and let us know if you still facing the same issue? If not, please modify the sample based on your scenario and revert us
with more details. It will be helpful for us to check on it and provide you the solution at the earliest. 
 
Regards,
Subburaj Pandian V
 


Loader.
Live Chat Icon For mobile
Up arrow icon