Monodroid Google Maps v2 - “LinkAssemblies”任务意外失败 [英] Monodroid Google Maps v2 - The "LinkAssemblies" task failed unexpectedly

查看:109
本文介绍了Monodroid Google Maps v2 - “LinkAssemblies”任务意外失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用新版Google地图v2制作monodroid应用程序。我为Google Play服务创建了一个绑定,并使用它。
当我处于调试模式时,这一切正常,但在发布时出现以下错误:

  System。例外:LinkAssemblies任务意外失败。 
Mono.Cecil.ResolutionException:未能解析
处的Android.App.Fragment Mono.Linker.Steps.MarkStep.MarkType(TypeReference引用)at
Mono.Linker.Steps.MarkStep.MarkType (TypeReference引用)at
Mono.Linker.Steps.MarkStep.InitializeType(TypeDefinition type)at
Mono.Linker.Steps.MarkStep.InitializeAssembly(AssemblyDefinition assembly)at
Mono.Linker.Steps Mono.Linker.Steps.MarkStep.Process(LinkContextcontext)上的.MarkStep.Initialize()at
Mono.Linker.Pipeline.Process(LinkContext上下文)at
MonoDroid.Tuner.Linker.Process(LinkerOptions选项) ,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服务绑定并映射它的作品。



有人可以帮忙吗?

编辑:我找到了一个解决方案:将链接设置为none。但我会喜欢它将链接集设置为仅限SDK组件,因为apk文件现在变得很大。

解决方案

此错误消息的最常见原因是,如果您使用的是不正确的Android SDK目标版本,如本文所述: https://kb.xamarin.com/customer/en/ portal / articles / 1902736-why-does-my-android-build-fail-with-error-execution-task-linkassemblies-error-xa2006-



要解决这个问题,你需要更新到正确的目标,这里显示: https://developer.xamarin.com/guides/xamarin-forms/getting-started/installation/#Android



另外,不时Xamarin.Android更新;这些目标可能会更新,所以即使您设置了今天的正确版本,如果您以后更新,最终可能需要再次更新。



(PS尽管该指南特定于Xamarin.Forms,但这些目标是从底层的Xamarin.Android工具继承而来的,所以即使您实际上没有使用Forms,这些设置也应该是相同的,但 Xamarin.Android。)

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.

解决方案

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

这篇关于Monodroid Google Maps v2 - “LinkAssemblies”任务意外失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆