本文介绍了Mono.Linker.MarkException:错误处理方法:'System.Void Plugin.LocalNotification.Platform.Droid.NotificationServiceImpl的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

将 Xamarin.Forms 版本更新到最新的稳定版本 4.6.0.800 后,同时在发布模式下构建时出错:

After updating Xamarin.Forms version to latest stable version 4.6.0.800 while making build in release mode getting error:

/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(5,5): Error XALNK7000: Mono.Linker.MarkException: Error processing method: 'System.Void Plugin.LocalNotification.Platform.Droid.NotificationServiceImpl::ShowLater(Plugin.LocalNotification.NotificationRequest)' in assembly: 'Plugin.LocalNotification.dll' ---> Mono.Cecil.ResolutionException: Failed to resolve AndroidX.Work.OneTimeWorkRequest/Builder AndroidX.Work.OneTimeWorkRequest/Builder::SetInitialDelay(System.Int64,Java.Util.Concurrent.TimeUnit)
at Mono.Linker.Steps.MarkStep.HandleUnresolvedMethod (Mono.Cecil.MethodReference reference) [0x00013] in <0275dd5bdfa6470181a4d79d0790489d>:0
at Mono.Linker.Steps.MarkStep.MarkMethod (Mono.Cecil.MethodReference reference) [0x0004a] in <0275dd5bdfa6470181a4d79d0790489d>:0
at Mono.Linker.Steps.MarkStep.MarkInstruction (Mono.Cecil.Cil.Instruction instruction) [0x00040] in <0275dd5bdfa6470181a4d79d0790489d>:0
at Mono.Linker.Steps.MarkStep.MarkMethodBody (Mono.Cecil.Cil.MethodBody body) [0x000c2] in <0275dd5bdfa6470181a4d79d0790489d>:0
at Mono.Linker.Steps.MarkStep.ProcessMethod (Mono.Cecil.MethodDefinition method) [0x00186] in <0275dd5bdfa6470181a4d79d0790489d>:0
at Mono.Linker.Steps.MarkStep.ProcessQueue () [0x0001b] in <0275dd5bdfa6470181a4d79d0790489d>:0
--- End of inner exception stack trace ---
at Mono.Linker.Steps.MarkStep.ProcessQueue () [0x00047] in <0275dd5bdfa6470181a4d79d0790489d>:0
at Mono.Linker.Steps.MarkStep.ProcessPrimaryQueue () [0x0000a] in <0275dd5bdfa6470181a4d79d0790489d>:0
at Mono.Linker.Steps.MarkStep.Process () [0x00102] in <0275dd5bdfa6470181a4d79d0790489d>:0
at Mono.Linker.Steps.MarkStep.Process (Mono.Linker.LinkContext context) [0x0000d] in <0275dd5bdfa6470181a4d79d0790489d>:0
at MonoDroid.Tuner.MonoDroidMarkStep.Process (Mono.Linker.LinkContext context) [0x0000b] in <0275dd5bdfa6470181a4d79d0790489d>:0
at Mono.Linker.Pipeline.ProcessStep (Mono.Linker.LinkContext context, Mono.Linker.Steps.IStep step) [0x0000d] in <0275dd5bdfa6470181a4d79d0790489d>:0
at Mono.Linker.Pipeline.Process (Mono.Linker.LinkContext context) [0x0000f] in <0275dd5bdfa6470181a4d79d0790489d>:0
at MonoDroid.Tuner.Linker.Run (Mono.Linker.Pipeline pipeline, Mono.Linker.LinkContext context) [0x00000] in <0275dd5bdfa6470181a4d79d0790489d>:0
at MonoDroid.Tuner.Linker.Process (MonoDroid.Tuner.LinkerOptions options, Mono.Linker.ILogger logger, Mono.Linker.LinkContext& context) [0x00071] in <0275dd5bdfa6470181a4d79d0790489d>:0
at Xamarin.Android.Tasks.LinkAssemblies.Execute (Java.Interop.Tools.Cecil.DirectoryAssemblyResolver res) [0x001dd] in <0275dd5bdfa6470181a4d79d0790489d>:0
at Xamarin.Android.Tasks.LinkAssemblies.RunTask () [0x0001b] in <0275dd5bdfa6470181a4d79d0790489d>:0
at Xamarin.Android.Tasks.AndroidTask.Execute () [0x00000] in <0275dd5bdfa6470181a4d79d0790489d>:0 (XALNK7000)

有人知道解决方案吗?

推荐答案

我回答了我自己的问题,几天后我终于找到了解决这个问题的方法.这可能对正在寻找解决方案的人有所帮助.

I answered my own question, finally after few days I have got the workaround for this issue. It might be helpful to someone who's looking for the solution.

  • 将网络标准更新为 2.1
  • 将 Plugin.LocalNotification 更新到最新版本 5.0.4
  • 删除不必要的 Android X 块
  • 删除 Xamarin.Android.Support.v7.MediaRouter
  • 在发布模式下启用 Multidex
  • 删除 bin/obj 并重建应用程序 [现在可以使用]
  • 从 Android & 中删除所有软件包iOS项目
  • 仅将包添加到 PCL/Net 标准项目
  • 在Android & 中添加Core 项目的引用iOS项目
  • 必须使用最新版本的 Plugin.LocalNotification 5.0.4

这篇关于Mono.Linker.MarkException:错误处理方法:'System.Void Plugin.LocalNotification.Platform.Droid.NotificationServiceImpl的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-29 16:52