Linker with Release configuration not working.

Alexandre_SAlexandre_S ✭✭USMember ✭✭

Can't find solution for this issue even after applying the last Xamarin update 4.2.1.64 and using VS2015 (update3)

When using Linker with Sdk Asemblies Only, it works on Debug but not on Release configuration, the follow error appears:


"The "LinkAssemblies" task failed unexpectedly.
Java.Interop.Tools.Diagnostics.XamarinAndroidException: error XA2006: Reference to metadata item 'System.Security.Cryptography.Xml.SignedXml' (defined in 'Microsoft.Build.Tasks.v4.0, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a') from 'Microsoft.Build.Tasks.v4.0, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' could not be resolved. ---> Mono.Cecil.ResolutionException: Failed to resolve System.Security.Cryptography.Xml.SignedXml
at Mono.Linker.Steps.MarkStep.MarkType(TypeReference reference)
at MonoDroid.Tuner.MonoDroidMarkStep.MarkType(TypeReference reference)
at Mono.Linker.Steps.MarkStep.MarkType(TypeReference reference)
at MonoDroid.Tuner.MonoDroidMarkStep.MarkType(TypeReference reference)
at Mono.Linker.Steps.MarkStep.InitializeType(TypeDefinition type)
at Mono.Linker.Steps.MarkStep.InitializeAssembly(AssemblyDefinition assembly)
at Mono.Linker.Steps.MarkStep.Initialize()
at Mono.Linker.Steps.MarkStep.Process(LinkContext context)
at Mono.Linker.Pipeline.Process(LinkContext context)
at MonoDroid.Tuner.Linker.Process(LinkerOptions options, LinkContext& context)
at Xamarin.Android.Tasks.LinkAssemblies.Execute()
-- End of inner exception stack trace --
at Java.Interop.Tools.Diagnostics.Diagnostic.Error(Int32 code, Exception innerException, String message, Object[] args)
at Xamarin.Android.Tasks.LinkAssemblies.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.d__26.MoveNext()"


I have nowhere references to System.Security, I have try with putting Skip linking assemblies to : "System.Security;System.Runtime;System.Runtime.Serialization;System.Runtime.Extensions;System.Runtime.Serialization.Json;System.Runtime.Serialization.Primitives;System.Runtime.InteropServices;System.Runtime.Extensions;EntityFramework"

Previously I had the same error with "System.Runtime", but now it's "System.Security"

To make it work on Release configuration only Linking "none" is building the project.

Some solutions? I guess something is caching or remembering the reference to this assemblies.

I use the follow components:

  • Google Cloud Messaging Client
  • GifImageView
  • Google Play Services - CLoud Messaging (GCM)
  • HockeyApp for Android
  • Json.NET
  • Android Support Design Lib
  • Android Support Lib
  • Xamarin.Auth

Nuget Packages:

  • Xamarin.FFImageLoading
  • Net46-Portable.DataAnnotations
  • EntityFramework

Thanks for the help

Answers

  • BerayBentesenBerayBentesen ✭✭✭✭ TRUniversity ✭✭✭✭

    @Alexandre_S you don't need GifImageView and FFImageLoading since Glide can does each process far better than those libraries.

    If you can build with Linking none, you need to find library that cause a problem.

  • Alexandre_SAlexandre_S ✭✭ USMember ✭✭

    I dont know which one is causing the problem, how to find out?

    thx for the tips about Glide, but for the moment that not on my list.

  • BerayBentesenBerayBentesen ✭✭✭✭ TRUniversity ✭✭✭✭

    @Alexandre_S

    Can you disable :

    System.Exception
    System.SystemException
    System.Security.Cryptography.CryptographicException 
    

    and try rebuild ?

  • Alexandre_SAlexandre_S ✭✭ USMember ✭✭

    what do you mean by disable?

    I dont use:

    • System.SystemException
    • System.Security.Cryptography.CryptographicException
      but

    • System.Exception
      is almost used on every activity/fragment

  • REJAHREJAH ✭✭ Member ✭✭

    I have same error how to resolve it pls help.

    Severity Code Description Project File Line Suppression State
    Error The "LinkAssemblies" task failed unexpectedly.
    Mono.Linker.MarkException: Error processing method: 'System.Void FAB.Droid.FloatingActionButtonRenderer::SetBackgroundColors()' in assembly: 'FAB.Droid.dll' ---> Mono.Cecil.ResolutionException: Failed to resolve System.Void Android.Support.Design.Widget.FloatingActionButton::SetRippleColor(System.Int32)
    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 MonoDroid.Tuner.MonoDroidMarkStep.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.d__26.MoveNext() VedantaMealBookingApp.Android

Sign In or Register to comment.