Mono.Linker.MarkException

12 posts, 0 answers
  1. Gerry
    Gerry avatar
    34 posts
    Member since:
    Jan 2017

    Posted 22 May 2018 Link to this post

    Suddenly can link debug but not release build:

    C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1812,5):
     error MSB4018: Mono.Linker.MarkException: Error processing method: 'System.Void Telerik.XamarinForms.DataGrid.RadDataGridResourceDictionary::InitializeComponent()'
     in assembly: 'Telerik.XamarinForms.DataGrid.dll' ---> Mono.Cecil.ResolutionException: Failed to resolve System.Func`2<System.String,System.String> Xamarin.Forms.Internals.ResourceLoader::get_ResourceProvider()

    Possibly related to today's Visual Studio update 15.7.2.

    Also, if I go into Android Options and set "Used Shared Runtime" to true, it will link, but it cannot be "Archived". It says that option must be turned off. Archive is what I am trying to do.

    Any thoughts?

  2. Lance | Manager Technical Support
    Admin
    Lance | Manager Technical Support avatar
    1168 posts

    Posted 24 May 2018 Link to this post

    Hello Gerry,

    The reason for this exception is because the project is likely using a version of Xamarin.Forms later than v2.5.1.527436. Xamarin made a breaking change to the signature of a method that is used to load resources from ResourceDictionaries.

    Please up-vote and subscribe to this Feedback Portal item to be immediately notified of status changes: LinkAssemblies Build Errors with Xamarin.Forms 3.0


    Current Progress

    This is a very high priority item and the development team is working hard on providing support Xamarin.Forms 3.0 in an upcoming update. Due to the nature of the breaking change, there's unfortunately no workaround we can provide when using UI for Xamarin 208.2.516 with Xamarin.Forms 3.0. The only solution at this time is to use Xamarin.Forms 2.5.1.527436 or earlier.

    I will also keep this thread open so that I can personally come back here and update you when a solution becomes available.

    Regards,
    Lance | Tech Support Engineer, Sr.
    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. Gerry
    Gerry avatar
    34 posts
    Member since:
    Jan 2017

    Posted 25 May 2018 in reply to Lance | Manager Technical Support Link to this post

    Thanks for getting back to me Lance.

    I was forced to upgrade for Forms 3.0 recently due to a previous Visual Studio update, more here: https://forums.xamarin.com/discussion/comment/330648#Comment_330648. Visual Studio updates have been a nightmare lately.

    The fix for me in the short term:

    Android Options, Linking, select "None".
    Works but the apk is nearly 100 Mb, previously 42 or so.

  4. Lance | Manager Technical Support
    Admin
    Lance | Manager Technical Support avatar
    1168 posts

    Posted 25 May 2018 Link to this post

    Hello Gerry,

    Thanks for sharing that thread. I'll also keep my eye out for other similar reports like that. 

    In case you want to follow, here's the Issue I filed with Xamarin to try and get to the bottom of the exception you're seeing: https://github.com/xamarin/Xamarin.Forms/issues/2835. We know why it's failing, but what can be done about it remains to be seen.

    The permanent fix would be to update UI for Xamarin's minimum required Xamarin.Forms version to 3.0, but we need to fully test it. The dev team has done a few tests on a XF 3.0 branch, but would need more rigorous Unit and UI tests before we could release this. Additionally, we need to consideration the ramifications of such a change for existing users.

    Regards,
    Lance | Tech Support Engineer, Sr.
    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
  5. Lance | Manager Technical Support
    Admin
    Lance | Manager Technical Support avatar
    1168 posts

    Posted 01 Jun 2018 Link to this post

    Hello Gerry,

    Xamarin was able to fix the problem, take a look at my reply here for the rest of the good news: https://www.telerik.com/forums/linkassemblies-errors-after-upgrade-to-xamarin-forms-v3-0#4vOcpoJtq0iYzOB08Zvvag

    Regards,
    Lance | Tech Support Engineer, Sr.
    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
  6. Gerry
    Gerry avatar
    34 posts
    Member since:
    Jan 2017

    Posted 04 Jun 2018 Link to this post

    I have upgraded to Visual Studio 15.7.3 and Xamarin Forms 3.1 nightly, but it seems the problem has moved from Telerik.XamarinForms.DataGrid.dll to Telerik.XamarinForms.Input.dll

    Error        The "LinkAssemblies" task failed unexpectedly.
    Mono.Linker.MarkException: Error processing method: 'System.Void Telerik.XamarinForms.Input.RadNumericInputResourceDictionary::InitializeComponent()'
    in assembly: 'Telerik.XamarinForms.Input.dll' ---> Mono.Cecil.ResolutionException:
    Failed to resolve System.Func`2<System.String,System.String> Xamarin.Forms.Internals.ResourceLoader::get_ResourceProvider()
       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 ---

     

     

  7. Lance | Manager Technical Support
    Admin
    Lance | Manager Technical Support avatar
    1168 posts

    Posted 05 Jun 2018 Link to this post

    Hi Gerry,

    Can you share the version number you're using? As far as I'm aware, the fix isn't in any public-facing releases yet. The Xamarin Team told me it would make it into SR3 and the package I tested the fix with was with a build off the build machines and not via NuGet.

    Regards,
    Lance | Tech Support Engineer, Sr.
    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
  8. Gerry
    Gerry avatar
    34 posts
    Member since:
    Jan 2017

    Posted 05 Jun 2018 in reply to Lance | Manager Technical Support Link to this post

    3.1.0.506097-nightly

    and you set Android Options/Linking to "Sdk Assemblies Only"?

  9. Gerry
    Gerry avatar
    34 posts
    Member since:
    Jan 2017

    Posted 05 Jun 2018 in reply to Gerry Link to this post

    I tried setting Android Options/Linking to "Sdk and User Assemblies" but that consistently crashes javac.exe
  10. Lance | Manager Technical Support
    Admin
    Lance | Manager Technical Support avatar
    1168 posts

    Posted 05 Jun 2018 Link to this post

    Hello Gerry,

    That nightly build was released on May 19th, you can see the date here in the NuGet Package Manager:

    :


    The latest available packages via NuGet are 3.0 sr2 or 3.1 pre-2 releases (neither have the fix). The fix is confirmed included in the release-3.0.0-sr3 and beta-3.1.0-pre3 when they become available for download/install.

    I will be sure to update the status of the UI for Xamarin Feedback Portal Item once it's publicly available, if you're following it, you'll be notified immediately.

    Regards,
    Lance | Tech Support Engineer, Sr.
    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
  11. Gerry
    Gerry avatar
    34 posts
    Member since:
    Jan 2017

    Posted 05 Jun 2018 in reply to Lance | Manager Technical Support Link to this post

    Thanks. Silly me, I thought "nightly" meant, "nightly".
  12. Lance | Manager Technical Support
    Admin
    Lance | Manager Technical Support avatar
    1168 posts

    Posted 05 Jun 2018 Link to this post

    Hello Gerry,

    You're right, there just seems to be a problem with UI tests for the branch that creates the nightly packages. I think I used the right twitter account for you in my conversation with David (the Xamarin.Forms PM), but in case I didn't here's what he said:

    "there are failing UITests in that branch that are identified and planned to be fixed. Until they pass a new release will not appear there."

    Regards,
    Lance | Tech Support Engineer, Sr.
    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