gpt4 book ai didi

c# - 链接程序集意外失败 (Xamarin.ios.dll)

转载 作者:行者123 更新时间:2023-11-29 05:33:31 25 4
gpt4 key购买 nike

当我尝试在 Release模式下编译时,出现错误,而在 Debug模式下效果很好。我正在尝试存档 APK,但由于 Xamarin.ios.dll 错误而无法存档

我尝试删除 obj 和 bin 文件夹并单独重新编译它们,它确实有效,但是当我尝试存档时,出现错误,要求我检查是否可以编译该项目。

Severity Code Description Project File Line Suppression State
Error The "LinkAssemblies" task failed unexpectedly.
Mono.Linker.MarkException: Error processing method: 'System.Void System.Net.Http.NSUrlSessionHandler/NSUrlSessionDataTaskStream/<ReadAsync>d__14::MoveNext()' in assembly: 'Xamarin.iOS.dll' ---> System.ArgumentNullException: Value cannot be null.
Parameter name: instruction at Mono.Cecil.Cil.InstructionOffset..ctor(Instruction instruction) at Mono.Cecil.Cil.CodeReader.ReadAsyncMethodBody(AsyncMethodBodyDebugInformation async_method) at Mono.Cecil.Cil.CodeReader.ReadCustomDebugInformations(MethodDefinition method) at Mono.Cecil.Cil.CodeReader.ReadDebugInfo() at Mono.Cecil.Cil.CodeReader.ReadMethodBody() at Mono.Cecil.Cil.CodeReader.ReadMethodBody(MethodDefinition method) at Mono.Cecil.MetadataReader.ReadMethodBody(MethodDefinition method) at Mono.Cecil.MethodDefinition.<>c.<get_Body>b__41_0(MethodDefinition method, MetadataReader reader) at Mono.Cecil.ModuleDefinition.Read[TItem,TRet](TRet& variable, TItem item, Func`3 read)
at Mono.Cecil.MethodDefinition.get_Body()
at Mono.Linker.Steps.MarkStep.ProcessMethod(MethodDefinition method)
at Mono.Linker.Steps.MarkStep.ProcessQueue()
--- End of inner exception stack trace ---
at Mono.Linker.Steps.MarkStep.ProcessQueue()
at Mono.Linker.Steps.MarkStep.ProcessPrimaryQueue()
at Mono.Linker.Steps.MarkStep.Process()
at MonoDroid.Tuner.MonoDroidMarkStep.Process(LinkContext context)
at Mono.Linker.Pipeline.ProcessStep(LinkContext context, IStep step)
at Mono.Linker.Pipeline.Process(LinkContext context)
at MonoDroid.Tuner.Linker.Process(LinkerOptions options, ILogger logger, LinkContext& context) 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() MultiPlatFormXamarin.Android

此外,Xamarin.iOS 引用了 Xamarin.Android,对吗?

最佳答案

由于 APK 适用于 Android,因此您绝对不应该在项目中引用 Xamarin.iOS。检查您的 Android 引用,并确保右键单击您的解决方案,转到“选项”、“配置”、“配置映射”,然后在构建 Android 时取消选中您的 iOS 项目(即在“任何 CPU”中构建时)

关于c# - 链接程序集意外失败 (Xamarin.ios.dll),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57294302/

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