Xamarin.forms: Error Mono.Linker.MarkException: Error processing method: 'System.Void Xamarin.Forms.Material.Android.MaterialSliderRenderer::OnElementPropertyChanged

Created on 26 Feb 2020  ·  7Comments  ·  Source: xamarin/Xamarin.Forms

Description

Can't compile my application on Release mode anymore

Error Mono.Linker.MarkException: Error processing method: 'System.Void Xamarin.Forms.Material.Android.MaterialSliderRenderer::OnElementPropertyChanged(System.Object,System.ComponentModel.PropertyChangedEventArgs)' in assembly: 'Xamarin.Forms.Material.dll' ---> Mono.Cecil.ResolutionException: Failed to resolve System.Boolean Xamarin.Forms.Platform.Android.PropertyChangedEventArgsExtensions::IsOneOf(System.ComponentModel.PropertyChangedEventArgs,Xamarin.Forms.BindableProperty[]) 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 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.RunTask() at Xamarin.Android.Tasks.AndroidTask.Execute()

visual Android needs-info ❓ unverified bug

Most helpful comment

I am also having this issue
XF version 4.5.0.617
VS 16.5.4

but my porblem, was resolved later by upgrading the nuget packages
Xamarin.Form.Visual.Material to the same version as Xamarin.forms
and upgrading the RG popup plugin nuget to 2.0.2
and also cleaning and deleting bin/obj of the android project.

All 7 comments

Could you attach a repro sample?. If this is not possible, you could share more information such as:

  • Xamarin.Forms version used, etc.

Xamarin.Forms: 4.5.0.282-pre4
Xamarin.Forms.Visual.Material 4.4.0.991640

PS:
The error occurs with Xamarin.Forms 4.4.0.991640 too.

I returned Xamarin.Forms until version 4.2, and the error continued.
After that, I installed the stable version of Visual Studio and managed to compile normally.

@mariohik What version of Visual Studio were you previously using and what version are you now using? Thanks!

This error was happening in Version 16.5.0 Preview 4.0.
I just upgraded to Version 16.5.0 Preview 5.0 and the error is no longer occurring.

I have this error in Visual Studio 16.5.3

1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1942,5): error XALNK7000: Mono.Linker.MarkException: Error processing method: 'System.Void Xamarin.Forms.Material.Android.MaterialColors::ApplySeekBarColors(Android.Widget.AbsSeekBar,Xamarin.Forms.Color,Xamarin.Forms.Color,Xamarin.Forms.Color)' in assembly: 'Xamarin.Forms.Material.dll' ---> Mono.Cecil.ResolutionException: Failed to resolve System.Void Xamarin.Forms.Platform.Android.DrawableExtensions::SetColorFilter(Android.Graphics.Drawables.Drawable,Android.Graphics.Color,Xamarin.Forms.Platform.Android.FilterMode)
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1942,5): error XALNK7000: at Mono.Linker.Steps.MarkStep.HandleUnresolvedMethod(MethodReference reference)
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1942,5): error XALNK7000: at Mono.Linker.Steps.MarkStep.MarkMethod(MethodReference reference)
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1942,5): error XALNK7000: at Mono.Linker.Steps.MarkStep.MarkInstruction(Instruction instruction)
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1942,5): error XALNK7000: at Mono.Linker.Steps.MarkStep.MarkMethodBody(MethodBody body)
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1942,5): error XALNK7000: at Mono.Linker.Steps.MarkStep.ProcessMethod(MethodDefinition method)
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1942,5): error XALNK7000: at Mono.Linker.Steps.MarkStep.ProcessQueue()
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1942,5): error XALNK7000: --- End of inner exception stack trace ---
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1942,5): error XALNK7000: at Mono.Linker.Steps.MarkStep.ProcessQueue()
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1942,5): error XALNK7000: at Mono.Linker.Steps.MarkStep.ProcessPrimaryQueue()
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1942,5): error XALNK7000: at Mono.Linker.Steps.MarkStep.Process()
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1942,5): error XALNK7000: at Mono.Linker.Steps.MarkStep.Process(LinkContext context)
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1942,5): error XALNK7000: at MonoDroid.Tuner.MonoDroidMarkStep.Process(LinkContext context)
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1942,5): error XALNK7000: at Mono.Linker.Pipeline.ProcessStep(LinkContext context, IStep step)
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1942,5): error XALNK7000: at Mono.Linker.Pipeline.Process(LinkContext context)
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1942,5): error XALNK7000: at MonoDroid.Tuner.Linker.Process(LinkerOptions options, ILogger logger, LinkContext& context)
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1942,5): error XALNK7000: at Xamarin.Android.Tasks.LinkAssemblies.Execute(DirectoryAssemblyResolver res)
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1942,5): error XALNK7000: at Xamarin.Android.Tasks.LinkAssemblies.RunTask()
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1942,5): error XALNK7000: at Xamarin.Android.Tasks.AndroidTask.Execute()

I am also having this issue
XF version 4.5.0.617
VS 16.5.4

but my porblem, was resolved later by upgrading the nuget packages
Xamarin.Form.Visual.Material to the same version as Xamarin.forms
and upgrading the RG popup plugin nuget to 2.0.2
and also cleaning and deleting bin/obj of the android project.

Was this page helpful?
0 / 5 - 0 ratings