LinkAssemblies任务失败

时间:2016-05-25 17:21:19

标签: xamarin xamarin.android xamarin.forms

Severity    Code    Description Project File    Line    Suppression State
Error       The "LinkAssemblies" task failed unexpectedly.
Xamarin.Android.XamarinAndroidException: error XA2006: Reference to metadata      
item 'System.Void Android.Widget.TextView::SetTextAppearance(System.Int32)' (defined in 'Xamarin.Forms.Platform.Android, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null') from 'Xamarin.Forms.Platform.Android, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null' could not be resolved. ---> Mono.Cecil.ResolutionException: Failed to resolve System.Void Android.Widget.TextView::SetTextAppearance(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__26.MoveNext()    FeedReader.Droid    

我正在尝试构建My Xamarin.Adroid项目以供发布。但我一直得到这个错误。网络上的一般共识是我的定位框架和最低版本的SDK必须是这样的,但我已经尝试过它们都无济于事。

enter image description here

这些SDK都安装在我的机器上,我还添加了最新的Xamarin表格预览。

enter image description here

我正在尝试的任何东西似乎都没有用。任何有关这方面的帮助将不胜感激。

提前谢谢。

2 个答案:

答案 0 :(得分:2)

看起来方法Android.Widget.TextView::SetTextAppearance(System.Int32)首次出现在API23中:M。您需要将编译和/或目标版本更改为指向M.

答案 1 :(得分:0)

更新xamarin版本后,我开始得到错误。首先清理项目然后再次构建它。为我固定。重建不起作用。