How to create custom linker using XML file for resolving the linker issue in XF Android platform

Dinesh4693Dinesh4693 INMember ✭✭

Hi Team,

I have referred the following Xamarin guide link to create a new custom linker using XML file in Android renderer project(Custom Level source) to skip the reflection codes and Linq codes in my custom control project.

Xamarin Link: https://developer.xamarin.com/guides/cross-platform/advanced/custom_linking/

I have skipped the particular namespace and type of class in the XML file as like below code snippet but still it throws the exceptions for example “Default constructor for MyCustomControl is not found“.

Code Example:
<?xml version="1.0" encoding="utf-8" ?> <linker> <assembly fullname="MyCustomControl.Portable"> <namespace fullname=" MyCustomControl "> <type fullname=" MyCustomControl .LoadGroup *" /> </namespace> </assembly> </linker>

Note: The above code snippet and exception is just an example. Actually multiple exceptions such as method missing , no count exists etc.., exception has been thrown due to reflection and defining the instance of class in XAML file at sample level.

I have also referred the following links to sort out this issue.
https://forums.xamarin.com/discussion/17406/custom-linking-how-to-do-wildcards
https://xamarinhelp.com/xamarin-linker/
https://lostechies.com/jimmybogard/2014/11/11/dealing-with-the-linker-in-xamarin-apps/

But none of them, guide and provide a clear example(May be I was wrong to understood it) to me to understand the actual usage of custom linker and how to preserve the assemblies, particular type, methods, fields etc..,

So, can anyone please guide me in a right direction to know actual purpose and to sort out from this?

Thanks in Advance,
Dinesh Babu Yadav

Sign In or Register to comment.