Xamarin Android error during Release compilation. XALNK7001: System.NullReferenceException at MonoDroid.Tuner.AddKeepAlivesStep.AddKeepAlives

Bado-dev 1 Reputation point
2022-09-24T09:13:39.253+00:00

I've an Android app that compiles and runs in Debug mode.
When I set it to Release mode, I receive following error during compilation:

    XALNK7001: System.NullReferenceException: Object reference not set to an instance of an object.  
   at MonoDroid.Tuner.AddKeepAlivesStep.AddKeepAlives(TypeDefinition type)  
   at MonoDroid.Tuner.AddKeepAlivesStep.AddKeepAlives(AssemblyDefinition assembly)  
   at MonoDroid.Tuner.AddKeepAlivesStep.ProcessAssembly(AssemblyDefinition assembly)  
   at Mono.Linker.Steps.BaseStep.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/runner/work/1/s/xamarin-android/external/xamarin-android-tools/src/Microsoft.Android.Build.BaseTasks/AndroidTask.cs:line 17 Jokes.Droid       

      

Can anyone help me? What could be the reason of this error?

Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,340 questions
Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
5,070 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.