Search code examples
androidxamarin.formsinversion-of-controlprismdryioc

The "LinkAssemblies" task failed unexpectedly after Xamarin Forms update to 3.1


I have recently updated my solution from Xamarin Forms 2.5 to 3.1. I have installed the package Prism.DryIoc.Forms 7.0.0.396 on the different applications (UWP, IOS, Android). Everything works as expected since the update with UWP but when I try to launch my Android project, it get this error :

Severity    Code    Description Project File    Line    Suppression State
Error       The "LinkAssemblies" task failed unexpectedly.
Mono.Linker.MarkException: Error processing method: 'System.Void Prism.DryIoc.PrismApplication::RegisterRequiredTypes(Prism.Ioc.IContainerRegistry)' in assembly: 'Prism.DryIoc.Forms.dll' ---> Mono.Cecil.ResolutionException: Failed to resolve System.Void DryIoc.Registrator::Register(DryIoc.IRegistrator,DryIoc.IReuse,DryIoc.Made,DryIoc.Setup,DryIoc.IfAlreadyRegistered,System.Object)
   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 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.Execute()
   at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
   at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext() AllyNations.Android C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets    1812    

I have never had to deal with LinkAssemblies before. The linking in my Android options is set to none. The code in my MainActivity.cs (Android) and App.xaml.cs has not been changed and is correct.


Solution

  • Dan Siegel answered this :

    This issue is caused by your changing major versions. For now you'll need to roll back to 2.X, we'll be updating to DryIoc 3 soon