“链接组件"在发布模式下构建解决方案时任务意外失败 [英] The "LinkAssemblies" task failed unexpectedly on build solution in Release mode
本文介绍了“链接组件"在发布模式下构建解决方案时任务意外失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的项目在 Debug
模式下成功构建,但是当我将其更改为 Release
模式时;即将出现以下异常:
My project is building successfully on the Debug
mode, but when I change it to the Release
mode; the following exception is coming:
Severity Code Description Project File Line Suppression State
Error The "LinkAssemblies" task failed
unexpectedly.Java.Interop.Tools.Diagnostics.XamarinAndroidException: error
XA2006: Could not resolve reference to 'Android.Views.KeyboardShortcutGroup'
(defined in assembly 'Xamarin.Android.Support.v7.AppCompat,
Version=1.0.0.0,Culture=neutral, PublicKeyToken=null') with scope
'Mono.Android,Version=0.0.0.0,
Culture=neutral,PublicKeyToken=84e04ff9cfb79065'.When the scope is
differentfromthe defining assembly, it usually means that the type is
forwarded.---> Mono.Cecil.ResolutionException: Failed to
resolveAndroid.Views.KeyboardShortcutGroup
at Mono.Linker.Steps.MarkStep.MarkType(TypeReference reference)
at MonoDroid.Tuner.MonoDroidMarkStep.MarkType(TypeReference reference)
at Mono.Linker.Steps.MarkStep.MarkGenericArguments(IGenericInstance
instance)
at Mono.Linker.Steps.MarkStep.GetOriginalType(TypeReference type)
at Mono.Linker.Steps.MarkStep.MarkType(TypeReference reference)
at MonoDroid.Tuner.MonoDroidMarkStep.MarkType(TypeReference reference)
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.Run(Pipeline pipeline, LinkContext context)
at MonoDroid.Tuner.Linker.Process(LinkerOptions options, LinkContext&
context)
at Xamarin.Android.Tasks.LinkAssemblies.Execute(DirectoryAssemblyResolver
res)
--- End of inner exception stack trace ---
at Java.Interop.Tools.Diagnostics.Diagnostic.Error(Int32 code, Exception
innerException, String message, Object[] args)
at Xamarin.Android.Tasks.LinkAssemblies.Execute(DirectoryAssemblyResolver
res)
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()
推荐答案
自 KeyboardShortcutGroup
起,您可能需要将目标 android 版本(在 Compile using Android version 下的 Android 项目属性中)增加到 API 24直到 API 24 才引入.
You may need to increase your target android version (within the Android project properties under Compile using Android version) to API 24 since KeyboardShortcutGroup
was not introduced until API 24.
这篇关于“链接组件"在发布模式下构建解决方案时任务意外失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文