gpt4 book ai didi

Xamarin LinkAssemblies 构建失败

转载 作者:行者123 更新时间:2023-12-02 01:10:17 28 4
gpt4 key购买 nike

我正在尝试在 Team Services 中发布我的 Xamarin.Android 应用程序,但出现以下错误:

The "LinkAssemblies" task failed unexpectedly.
Java.Interop.Tools.Diagnostics.XamarinAndroidException: error XA2006: Could
not resolve reference to 'System.Void.Android.Support.CustomTabs.CustomTabsIntent::LaunchUrl(Android.App.
Activity,Android.Net.Uri)' (defined in assembly
'Microsoft.Azure.Mobile.Client, Version=4.0.1.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35') with scope
'Xamarin.Android.Support.CustomTabs, Version=1.0.0.0, Culture=neutral,
PublicKeyToken=null'. When the scope is different from the defining
assembly, it usually means that the type is forwarded. --->
Mono.Cecil.ResolutionException: Failed to resolve System.Void.Android.Support.CustomTabs.CustomTabsIntent::LaunchUrl(Android.App.Activity,Android.Net.Uri)
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 MonoDroid.Tuner.MonoDroidMarkStep.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(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()

我可以看到它可能与包 Microsoft.Azure.Mobile.Client 有关,但不确定我需要做什么来解决它(我对 Xamarin 很陌生,所以不确定如何处理这些信息)。

我的 minSdkVersion 是 21。

谢谢

最佳答案

看起来 Microsoft.Azure.Mobile.Client 包的人对 Android.Support.CustomTabs 库有问题。请引用github上发布的问题:Issue 364Issue 361 .看起来 Microsoft.Azure.Mobile.Client 版本 4.0.0 可以针对 Android.Support.CustomTabs 版本 25.3.1 构建,但是 Microsoft.Azure.Mobile.Client 版本 4.0.1 可以针对 Android.Support.CustomTabs 版本构建23.3.0.

在我的案例中,将 nuget 包 Microsoft.Azure.Mobile.Client 从版本 4.0.1 降级到版本 4.0.0 有助于构建和链接我的项目。

关于Xamarin LinkAssemblies 构建失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45410591/

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