0

I developed an application using Xamarin and C# and I want to release it but when I try to release my application with Visual Studio 2019 or 2022(I tried both), I get this error:

Mono.Linker.MarkException: Error processing method: 'System.Void Plugin.CloudFirestore.FirestoreSettings::.cctor()' in assembly: 'Plugin.CloudFirestore.dll' ---> Mono.Cecil.ResolutionException: Failed to resolve System.Boolean Firebase.Firestore.FirebaseFirestoreSettings::AreTimestampsInSnapshotsEnabled()
   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()

I updated all my packages to the last version available and I deleted Bin and obj foders but without result..

During debug, it works correctly. If I test the application on my phone or with android emulator, it works.

Do you have any suggestion?

Spack09
  • 212
  • 1
  • 9

1 Answers1

0

I have searched about the Plugin.CloudFirestore in the error message you provided. The package's last update time is 12/2/2020. And the newest android version it supports is android 10.0.

So you can try to update version of the nuget packages in your project to the version which support the android 10.0 or which update time is similar as the 12/2/2020. Such as the Xamarin.Forms, Xamarin.Essentials and the other packages used in your project.

In addition, you can search about the error message(Mono.Linker.MarkException: Error processing method) you provided. There are many cases about the same error message. Such as Mono.Linker.MarkException: Error processing method: 'System.Void Plugin.LocalNotification.Platform.Droid.NotificationServiceImpl and Xamarin.Android Linking problem - Error processing method System.String.

Generally speaking, the casue should be the Plugin.CloudFirestore package. It's too old. You can try to remove this package and release the project again.

Liyun Zhang - MSFT
  • 8,271
  • 1
  • 2
  • 14