22751

Monodroid Google Maps v2 - The “LinkAssemblies” task failed unexpectedly

Question:

I'm making an app in monodroid, using the new Google Maps v2. I've created a binding for the Google Play Service, and used it. It all works fine when I'm in debug mode, but in release I get following error:

System.Exception: The "LinkAssemblies" task failed unexpectedly. Mono.Cecil.ResolutionException: Failed to resolve Android.App.Fragment at Mono.Linker.Steps.MarkStep.MarkType(TypeReference reference) at Mono.Linker.Steps.MarkStep.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(LinkContextcontext) at Mono.Linker.Pipeline.Process(LinkContext context) at MonoDroid.Tuner.Linker.Process(LinkerOptions options, LinkContext& context) at Xamarin.Android.Tasks.LinkAssemblies.Execute() at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execue() at Microsoft.Build.BackEnd.TaskBuilder.d__20.MoveNext()

If I remove the Google Play Service binding and map it works.

Someone who can help?

EDIT: I found a solution: set linking to none. But I will like it to work on linking set to "SDK assemblies only", because the apk-file become to large now.

Answer1:

The most common cause of this error message is if you're using incorrect Android SDK target versions, as described in this article: <a href="https://kb.xamarin.com/customer/en/portal/articles/1902736-why-does-my-android-build-fail-with-error-executing-task-linkassemblies-error-xa2006-" rel="nofollow">https://kb.xamarin.com/customer/en/portal/articles/1902736-why-does-my-android-build-fail-with-error-executing-task-linkassemblies-error-xa2006-</a>

To fix this, you need to update to the correct targets, which are shown here: <a href="https://developer.xamarin.com/guides/xamarin-forms/getting-started/installation/#Android" rel="nofollow">https://developer.xamarin.com/guides/xamarin-forms/getting-started/installation/#Android</a>

Additionally, from time to time as Xamarin.Android is updated; those targets may update as well, so even if you set the correct version 'today', if you update later eventually you may have to update them again down the road.

(P.S. Even though that guide is specific to Xamarin.Forms, those targets are inherited from the underlying Xamarin.Android tooling, so those settings should generally be the same even if you're not actually using Forms, but <em>just</em> Xamarin.Android.)

Recommend

  • Listing all the classes in a DLL
  • Best GAC Tutorial/Overview? [closed]
  • Wrap assemblies in .NET?
  • Issue with SVN Commit for certain File Extension
  • How do we generate stack trace in TOMCAT?
  • Catch 500 internal server error with System.WebClient
  • phpmailer - How to verify a sent email arrived at its destination
  • What's wrong with `var myEval = eval; myEval(“2+2”)`
  • Number of threads being used during Parallel.ForEach
  • get all processes in parallel
  • How to create a custom Powershell operator?
  • What does Main.1 output file do in XCode?
  • 'doc_del_count' bigger than 'doc_count' on CouchDB
  • Why can't I use non-integral types with switch [duplicate]
  • Get Currently Active User in Android
  • Failed to find version-tag string. File must be updated
  • C# Excel interop - how to test if interop object is still working and performing a task?
  • Translating C# to PowerShell in InterIMAP
  • select function not working in 3.5.4 version of d3.js
  • Google Places API - Find a company's CID and LRD
  • How can go in last activity with resume button?
  • MySQL performance when updating row with FK
  • Passing variable arguments using PowerShell's Start-Process cmdlet
  • Detecting null parameter in preprocessor macro
  • aapt.exe'' finished with non-zero exit value 1
  • Redshift Querying: error xx000 disk full redshift
  • Git describe fails to return most recent annotated tag
  • Adding elements to a huge XML file
  • Object and struct member access and address offset calculation
  • x64 applications using gdi+: what are the consequences on performance?
  • How can I sort a a table with VBA with given text condition?
  • How to format a variable of double type
  • VB.net deserialize, JSON Conversion from type 'Dictionary(Of String,Object)' to type '
  • How can I get HTML syntax highlighting in my editor for CakePHP?
  • C# - Getting references of reference
  • Understanding cpu registers
  • How do I configure my settings file to work with unit tests?
  • IndexOutOfRangeException on multidimensional array despite using GetLength check
  • Binding checkboxes to object values in AngularJs
  • How do I use LINQ to get all the Items that have a particular SubItem?