Shaine Fisher
Shaine Fisher

Reputation: 325

Xamarin Android LinkAssemblies task failed

Using Visual Studio 2017 Preview 15.4.0 and the latest updates to everything as of today. Whenever I build my project I get this error, as a workaround I have been turning linking to 'none' as suggested nearly everywhere, but this isn't a fix, and I would really appreciate some useful advice on what I can do to be able to publish this app the way it is supposed to be. The error is:

Severity Code Description Project File Line Suppression State Error The "LinkAssemblies" task failed unexpectedly. Mono.Linker.MarkException: Error processing method: 'System.Void Android.Support.CustomTabs.Chromium.SharedUtilities._MobileServices.CustomTabActivityHelper::LaunchUrlWithCustomTabsOrFallback(Android.App.Activity,Android.Support.CustomTabs.CustomTabsIntent,Android.Net.Uri,Android.Support.CustomTabs.Chromium.SharedUtilities._MobileServices.ICustomTabFallback)' in assembly: 'Microsoft.Azure.Mobile.Client.dll' ---> Mono.Cecil.ResolutionException: Failed to resolve System.Void Android.Support.CustomTabs.CustomTabsIntent::LaunchUrl(Android.App.Activity,Android.Net.Uri) 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.Process() 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(DirectoryAssemblyResolver res) at Xamarin.Android.Tasks.LinkAssemblies.Execute() at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() at Microsoft.Build.BackEnd.TaskBuilder.d__26.MoveNext() com.tapig.ria.quickmeme C:\Program Files (x86)\Microsoft Visual Studio\Preview\Community\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets 1591

I cannot remove this package as it is required by the Facebook. Android SDK wrapper client, but I also can't have my app size increased because of this issue, any ideas welcome.

EDIT: If I enable Android 4.4, which debugs perfectly on a device, I get this error too, under the same heading.

Mono.Linker.MarkException: Error processing method: 'System.Void Acr.UserDialogs.Fragments.AbstractDialogFragment`1::OnKeyPress(System.Object,Android.Content.DialogKeyEventArgs)' in assembly: 'Acr.UserDialogs.dll' ---> System.ArgumentNullException: Value cannot be null.
Parameter name: instruction
   at Mono.Cecil.Cil.InstructionOffset..ctor(Instruction instruction)
   at Mono.Cecil.Cil.CodeReader.ReadScope(ScopeDebugInformation scope)
   at Mono.Cecil.Cil.CodeReader.ReadScopes(Collection`1 scopes)
   at Mono.Cecil.Cil.CodeReader.ReadScope(ScopeDebugInformation scope)
   at Mono.Cecil.Cil.CodeReader.ReadScopes(Collection`1 scopes)
   at Mono.Cecil.Cil.CodeReader.ReadScope(ScopeDebugInformation scope)
   at Mono.Cecil.Cil.CodeReader.ReadDebugInfo()
   at Mono.Cecil.Cil.CodeReader.ReadMethodBody()
   at Mono.Cecil.Cil.CodeReader.ReadMethodBody(MethodDefinition method)
   at Mono.Cecil.MethodDefinition.<>c.<get_Body>b__41_0(MethodDefinition method, MetadataReader reader)
   at Mono.Cecil.ModuleDefinition.Read[TItem,TRet](TRet& variable, TItem item, Func`3 read)
   at Mono.Cecil.MethodDefinition.get_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.Process()
   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(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() com.tapig.ria.quickmeme C:\Program Files (x86)\Microsoft Visual Studio\Preview\Community\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets 1591    

Upvotes: 0

Views: 1896

Answers (2)

Ingweland
Ingweland

Reputation: 1079

I had similar issue, though the reason went from Xamarin.Auth library. By default, it automatically resolved to Xamarin.Android.Support.CustomTabs v 23.3.0. The fix was to manually add higher version to Android project (as of now it is 26.1.0.1).

Upvotes: 1

Wilson Vargas
Wilson Vargas

Reputation: 2899

Microsoft.Azure.Mobile.Client.dll is being referred from a different location in the android project references. Changing that will fix your issue.

Upvotes: 2

Related Questions