“链接组件"任务意外失败 [英] The "LinkAssemblies" task failed unexpectedly

查看:26
本文介绍了“链接组件"任务意外失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我们尝试在发布模式下构建 xamarin 表单项目时,我们收到错误:

When we are trying to build a xamarin forms project in release mode, we are getting the error:

C:Program Files (x86)MSBuildXamarinAndroidXamarin.Android.Common.targets(5,5): Error MSB4018: The "LinkAssemblies" task failed unexpectedly.
Xamarin.Android.XamarinAndroidException: error XA2006: Reference to metadata item 'System.Void Android.Widget.AbsListView::SetSelectionFromTop(System.Int32,System.Int32)' (defined in 'Xamarin.Forms.Platform.Android, Version=1.3.3.0, Culture=neutral, PublicKeyToken=null') from 'Xamarin.Forms.Platform.Android, Version=1.3.3.0, Culture=neutral, PublicKeyToken=null' could not be resolved. ---> Mono.Cecil.ResolutionException: Failed to resolve System.Void Android.Widget.AbsListView::SetSelectionFromTop(System.Int32,System.Int32)
   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()
   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()
   --- End of inner exception stack trace ---
   at Xamarin.Android.Diagnostic.Error(Int32 code, Exception innerException, String message, Object[] args)
   at Xamarin.Android.Tasks.LinkAssemblies.Execute()
   at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
   at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__20.MoveNext() (MSB4018) (XXX.Android)

我们如何解决这个问题?我们再次尝试清洁和建造.甚至关闭 xamarin studio 并重新启动它.似乎没有任何效果.

How can we resolve this? We have tried cleaning and building again. Even closing xamarin studio and restarting it. Nothing seems to work.

我们正在使用最新版本的 xamarin 表单和 xamarin 表单实验室.我们使用的最低 android API 级别是 17.我什至尝试过最低 sdk 版本 20.

We are on the latest release of xamarin forms and xamarin forms labs. The minimum android API level we are using is 17. I even tried minimum sdk version 20.

更多细节:

Xamarin Studio
Version 5.7 (build 661)
Installation UUID: f97e711d-1fe0-450f-a3bb-2d9b972ab295
Runtime:
    Microsoft .NET 4.0.30319.0
    GTK+ 2.24.22 (MS-Windows theme)
    GTK# 2.12.26

Xamarin.Android
Version: 4.20.0 (Indie Edition)
Android SDK: C:UsersKartikAppDataLocalAndroidandroid-sdk
    Supported Android versions:
        2.1    (API level 7)
        2.2    (API level 8)
        2.3    (API level 10)
        3.1    (API level 12)
        4.0    (API level 14)
        4.0.3  (API level 15)
        4.1    (API level 16)
        4.3    (API level 18)
        4.4    (API level 19)
        4.4.87 (API level 20)
        5.0    (API level 21)
Java SDK: C:Program Files (x86)Javajdk1.6.0_39
java version "1.6.0_39"
Java(TM) SE Runtime Environment (build 1.6.0_39-b04)
Java HotSpot(TM) Client VM (build 20.14-b01, mixed mode, sharing)

Build Information
Release ID: 507000661
Git revision: b70bab61da996da29045ea8ee8aed1a6faedbe78
Build date: 2015-01-05 11:27:37-05
Xamarin addins: 82f6c71490562d6cd125a09287f441902fdac3d7

Operating System
Windows 6.2.9200.0 (64-bit)

推荐答案

显然,这是一个已知问题:Xamarin Forms 需要 TargetAndroidVersion 为 21.(在配置 GUI 中,标题为使用 Android 版本编译:")

Apparently, this is a known issue: Xamarin Forms needs the TargetAndroidVersion to be 21. (In the config GUI, this is entitled "Compile using Android version:")

这篇关于“链接组件"任务意外失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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