Monodroid Google Maps v2 - “LinkAssemblies”任务意外失败

时间:2013-08-21 18:15:07

标签: android google-maps xamarin.android xamarin

我正在使用新的Google Maps v2在monodroid中制作应用。我为Google Play服务创建了一个绑定并使用它。 当我处于调试模式时,一切正常,但在发布中,我得到以下错误:

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

如果我删除Google Play服务绑定并将其映射有效。

有人可以提供帮助吗?

编辑:我找到了一个解决方案:设置链接为无。但我希望它能够将set设置为“仅限SDK程序集”,因为apk文件现在变得很大。

1 个答案:

答案 0 :(得分:0)

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

To fix this, you need to update to the correct targets, which are shown here: https://developer.xamarin.com/guides/xamarin-forms/getting-started/installation/#Android

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 just Xamarin.Android.)