This is a migrated thread and some comments may be shown as answers.
Mono.Linker.MarkException
11 Answers 70 Views
This is a migrated thread and some comments may be shown as answers.
Gerry
Top achievements
Rank 1
Gerry asked on 22 May 2018, 07:34 PM

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?

11 Answers, 1 is accepted

Sort by
0
Lance | Manager Technical Support
Telerik team
answered on 24 May 2018, 10:18 PM
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
0
Gerry
Top achievements
Rank 1
answered on 25 May 2018, 03:30 PM

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.

0
Lance | Manager Technical Support
Telerik team
answered on 25 May 2018, 10:23 PM
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
0
Lance | Manager Technical Support
Telerik team
answered on 01 Jun 2018, 02:32 PM
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
0
Gerry
Top achievements
Rank 1
answered on 04 Jun 2018, 09:34 PM

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 ---

 

 

0
Lance | Manager Technical Support
Telerik team
answered on 05 Jun 2018, 12:49 PM
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
0
Gerry
Top achievements
Rank 1
answered on 05 Jun 2018, 02:50 PM

3.1.0.506097-nightly

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

0
Gerry
Top achievements
Rank 1
answered on 05 Jun 2018, 02:57 PM
I tried setting Android Options/Linking to "Sdk and User Assemblies" but that consistently crashes javac.exe
0
Lance | Manager Technical Support
Telerik team
answered on 05 Jun 2018, 07:39 PM
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
0
Gerry
Top achievements
Rank 1
answered on 05 Jun 2018, 08:50 PM
Thanks. Silly me, I thought "nightly" meant, "nightly".
0
Lance | Manager Technical Support
Telerik team
answered on 05 Jun 2018, 10:57 PM
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
Asked by
Gerry
Top achievements
Rank 1
Answers by
Lance | Manager Technical Support
Telerik team
Gerry
Top achievements
Rank 1
Share this question
or