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