Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting this issue while creating a release build in xamarin application, Mono.Linker.MarkException: Error processing method: 'System.Void OxyPlot.Xamarin.Android.PlotView::OnDraw(Android.Graphics.Canvas)' in assembly: 'OxyPlot.Xamarin.Android.dll' #121

Open
SandeepChorge opened this issue Jan 11, 2022 · 4 comments
Labels

Comments

@SandeepChorge
Copy link

Hii, I am using Oxyplot.core 1.0.0 image

and currently facing issue while creating a release build of the application, getting following error

Severity Code Description Project File Line Suppression State
Error Mono.Linker.MarkException: Error processing method: 'System.Void OxyPlot.Xamarin.Android.PlotView::OnDraw(Android.Graphics.Canvas)' in assembly: 'OxyPlot.Xamarin.Android.dll' ---> Mono.Cecil.ResolutionException: Failed to resolve System.Void OxyPlot.IPlotModel::Render(OxyPlot.IRenderContext,System.Double,System.Double)
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 Microsoft.Android.Build.Tasks.AndroidTask.Execute() in /Users/builder/azdo/_work/1/s/xamarin-android/external/xamarin-android-tools/src/Microsoft.Android.Build.BaseTasks/AndroidTask.cs:line 17 SalesAssist.Android

is there any leads how to solve this issue, I also tried upgrading the nuget version to 2.1.0 still facing same issue

@VisualMelon
Copy link

The method doesn't exist in 2.1, and there is no OxyPlot.Xamarin targeting 2.1, so that won't be any help I'm afraid.

I don't know much about Xamarin, but some mindless googling suggests this may just be a tooling issue that may be resolved by cleaning the solution fully. Are you able to try building the project on a different machine?

@SandeepChorge
Copy link
Author

I tried cleaning and building the project it works just fine but at the time of Release APK creation it gives this error, and somehow my colleague does not get this issue on his System, I'll recheck again if there is any tooling issue

@janusw janusw added the Android label Dec 4, 2022
@janusw
Copy link
Member

janusw commented Jan 11, 2023

The method doesn't exist in 2.1, and there is no OxyPlot.Xamarin targeting 2.1, so that won't be any help I'm afraid.

In fact OxyPlot.Xamarin.Forms version 2.1.0 was released yesterday, so you could check if upgrading helps.

@janusw
Copy link
Member

janusw commented Jan 13, 2023

Error Mono.Linker.MarkException: Error processing method: 'System.Void OxyPlot.Xamarin.Android.PlotView::OnDraw(Android.Graphics.Canvas)' in assembly: 'OxyPlot.Xamarin.Android.dll' ---> Mono.Cecil.ResolutionException: Failed to resolve System.Void OxyPlot.IPlotModel::Render(OxyPlot.IRenderContext,System.Double,System.Double)

This really looks a lot like 2.0.0 -> 2.1.0 incompatibility: In the course of updating OxyPlot.Xamarin.Forms to be compatible with OxyPlot.Core 2.1.0, I had to update PlotView::OnDraw to call the new Render method, which takes any OxyRect as argument instead of two doubles, see #142 and in particular ad250aa.

I strongly suspect that this issue will be fixed by updating to OxyPlot.Xamarin.Forms 2.1.0. @SandeepChorge, could you please confirm that this is the case?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants