gpt4 book ai didi

android - "LinkAssemblies"任务在 Release模式下构建解决方案时意外失败

转载 作者:搜寻专家 更新时间:2023-11-01 09:34:58 25 4
gpt4 key购买 nike

我的项目在 Debug 模式下成功构建,但是当我将其更改为 Release 模式时;出现以下异常:

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

最佳答案

您可能需要将目标 android 版本(在使用 Android 版本编译下的 Android 项目属性中)增加到 API 24,因为直到 API 24 才引入 KeyboardShortcutGroup

关于android - "LinkAssemblies"任务在 Release模式下构建解决方案时意外失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44086909/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com