0

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    
1
  • Thank you for the edit, my head is all over the place today, appreciated. Commented Sep 11, 2017 at 15:59

2 Answers 2

2

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

Sign up to request clarification or add additional context in comments.

5 Comments

In the targets file? Out just generally in the project?
I have 2 entries in packages config, and that is the only place in the solution that it appears, as far as I can search and see: <package id="Microsoft.Azure.Mobile.Client" version="4.0.1" targetFramework="monoandroid71" /> <package id="Microsoft.Azure.Mobile.Client.SQLiteStore" version="4.0.1" targetFramework="monoandroid71" />
As per this question (stackoverflow.com/questions/37177430/…) I have tried those solutions, setting linking to none does solve the problem, but it is not a fix, and app size is an issue. Thanks for the suggestions :)
any ideas where I should be looking? I can't find any extra references.
Although there was not enough information in the answer to allow me to resolve the issue I have marked the answer as correct due to lack of interest.
1

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).

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.