Bug 52347 - GetMethod not found for Text Property when enable sdk and user assemblies
Summary: GetMethod not found for Text Property when enable sdk and user assemblies
Status: CONFIRMED
Alias: None
Product: Forms
Classification: Xamarin
Component: Android ()
Version: 2.3.3
Hardware: PC Windows
: Normal normal
Target Milestone: ---
Assignee: Chris King
URL:
Depends on:
Blocks:
 
Reported: 2017-02-07 04:19 UTC by Magesh Kumar
Modified: 2017-06-19 21:16 UTC (History)
6 users (show)

Tags: android, crash, custom control, custom renderer, ac
Is this bug a regression?: ---
Last known good build:


Attachments
I have attached the sample for your reference. (352.64 KB, application/x-zip-compressed)
2017-02-07 04:19 UTC, Magesh Kumar
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report for Bug 52347 on Developer Community or GitHub if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: Developer Community HTML or GitHub Markdown
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:
Status:
CONFIRMED

Description Magesh Kumar 2017-02-07 04:19:43 UTC
Created attachment 19744 [details]
I have attached the sample for your reference.

I have written custom view code for RadioButton in PCL project and renderer code in Android project.
I have a text property in PCL. I want to print the value of that text property using reflection in render. 
Everything works fine if linking is none. But if i change linking to sdk and user assemblies, it throws Get method not found for Text property exception.
I have attached the sample for your reference.
I have tried the below solutions:
1. Mark class members with [Preserve]
2. Mark an entire class with [Preserve(AllMembers=true)]
3. Mark an entire assembly with [assembly:Preserve].
4. A block of code so that the linker believes that the type is used, while preventing the block of code from being executed at runtime.
Syntax:
#pragma warning disable 0219, 0649.
//Code
#pragma warning restore 0219, 0649.

Any help would be appreciated.
Comment 1 Jimmy [MSFT] 2017-02-22 23:58:02 UTC
I am confirming this report since I can reproduce the issue with the attached project. However, let me look into this some more to determine whether this is a bug with Forms or Xamarin.Android instead.
Comment 2 Harikrishnan 2017-04-26 09:46:53 UTC
Hi @Jimmy Garrido

Am facing the sample problem. Any update on this? 
Any ETA when the issue will be fixed? Or is there any workaround to get rid of this?