gpt4 book ai didi

android - Xamarin.Forms 获取 Mono.Linker.MarkException : Error processing method when compiling in release mode

转载 作者:行者123 更新时间:2023-12-03 13:26:42 25 4
gpt4 key购买 nike

我有一个在 Windows 上使用 VS2017 (15.7.1) 的 Xamarin.Forms (2.5.1.527436) 应用程序。 android 项目在调试下构建并运行良好。但是,当我在 release 下构建时,出现以下错误:

Severity Code Description Project File Line Suppression State Error The "LinkAssemblies" task failed unexpectedly. Mono.Linker.MarkException: Error processing method: 'System.Void Xamarin.Forms.Pages.BaseDataSource/d__22::MoveNext()' in assembly: 'Xamarin.Forms.Pages.dll' ---> Mono.Cecil.ResolutionException: Failed to resolve System.Void Xamarin.Forms.Log::Warning(System.String,System.String) at Mono.Linker.Steps.MarkStep.HandleUnresolvedMethod(MethodReference reference) 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() --- 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 Mono.Linker.Steps.MarkStep.Process(LinkContext context) 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.d__26.MoveNext() IRMobile.Android C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets 1812



我正在链接“仅 Sdk 程序集”,最低 android 版本为 5.1(22 级),目标 Android 版本为 8.1(27 级)

有任何想法吗?

最佳答案

就我而言,经过大量研究后,我只是

  • 升级了一些 nuget 包 ,在 Forms、Android 和 iOS 的 3 个项目中,这解决了 Release模式下的问题。

  • 或者
  • 同时更改 链接到无 在不升级软件包的情况下解决了这个问题,但我认为不推荐。
  • 关于android - Xamarin.Forms 获取 Mono.Linker.MarkException : Error processing method when compiling in release mode,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50416001/

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