The "LinkAssemblies" task failed unexpectedly.

4 posts, 1 answers
  1. Graeme
    Graeme avatar
    2 posts
    Member since:
    Mar 2019

    Posted 11 Apr Link to this post

    Hi,

    I'm using Xamarin Forms 3.6.0.264807, Telerik UI for Xamarin 2019.1.318.1, .Net standard 2.0.3 and Visual Studio 2017 (Win 10).

    I would like to package and distribute the APK but in release mode the Android project fails to build. 

    This is the error (when linking SDK assemblies only):

    Error The "LinkAssemblies" task failed unexpectedly.
    Mono.Linker.MarkException: Error processing method: 'System.Void Telerik.XamarinForms.Common.PlatformCulture::.ctor(System.String)' in assembly: 'Telerik.XamarinForms.Common.dll' ---> Mono.Cecil.ResolutionException: Failed to resolve System.String[] System.String::Split(System.Char,System.StringSplitOptions)
       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.<ExecuteInstantiatedTask>d__26.MoveNext()

     

    A very similar error is produced when linking SDK and User assemblies.

    I have tried changing the linking (only None option works). 

    Many times I have cleaned, deleted all obj and bin folders, re-cleaned and rebuilt the project and it always fails when linking assemblies.

    I've removed all Telerik assemblies then the project will build successfully with either SDK or SDK and User assembly linking.

    I've updated to latest Xamarin Forms (3.6.0.293080) and this behaves exactly the same.

    I've looked through these forums and I have found similar problems, but most relate to upgrading XF from 2.X to 3.X.  This is not the case for my app, it started as a XF 3+ application.  I've only recently added Telerik assemblies and it all works fine in debug mode.

    The most similar issue is this post: https://www.telerik.com/forums/build-fails---can't-resolve-the-reference-'system-string-system-string-split(system-char-system-stringsplitoptions)'.  The differences are that my situation is Android project, and I am building/archiving using VS2017 (not hosted).

    Do you have any suggestions?

     

    Thanks,

    Graeme

     

     

     

     

     

  2. Answer
    Lance | Technical Support Engineer, Principal
    Admin
    Lance | Technical Support Engineer, Principal avatar
    1020 posts

    Posted 11 Apr Link to this post

    Hello Graeme,

    Can you check to make sure there are no pending updates for Visual Studio 2017? The fix for most of the folks having this problem was to update outdated tooling, try the following steps:

    1. Run the "Visual Studio Installer" application from your Start menu
    2. Check for updates on VS2017 and apply them (double check that the Mobile Development with .NET workload is checked)
    3. Once VS2017 and Xamarin tooling is updated, repeat the Clean, Rebuild and Archive steps (deleting every project's bin and obj folders is best clean).

    Since you have a support license, I can convert this forum thread into a support ticket so you can share private system info with us. If the above steps don't resolve the issue, let me know and I'll do the conversion and let you know what info to share.

    This will let me escalate the support ticket to the development team for further investigation.

    Regards,
    Lance | Technical Support Engineer, Principal
    Progress Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. Graeme
    Graeme avatar
    2 posts
    Member since:
    Mar 2019

    Posted 11 Apr in reply to Lance | Technical Support Engineer, Principal Link to this post

    Hi Lance,

    Thanks for your quick response.

    Just after posting I read the last entry in the post I linked to above where they state that upgrading VS fixed their issue.

    I've now upgraded VS from 15.8.x to 15.9.11.

    I can confirm that this resolved my issue.  My project now builds and archives in release mode.

    Thanks for your help.

    Graeme 

  4. Lance | Technical Support Engineer, Principal
    Admin
    Lance | Technical Support Engineer, Principal avatar
    1020 posts

    Posted 11 Apr Link to this post

    Hi Grame,

    Fantastic!  If I could make a final recommendation, mark a post in this thread as "answer" so that it's easier for other folks having this problem to find it in the future.

    If you have any further trouble, please don't hesitate to open a Support Ticket here. We do our best to answer forum posts within a reasonable timeframe, but this can be limited by available resources and may take a few days. Whereas a support ticket carries a guaranteed 24 hour response time.

    Thank you for reaching out and for choosing UI for Xamarin.

    Regards,
    Lance | Technical Support Engineer, Principal
    Progress Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top