RadioButton does not work in Xamarin Forms

Sree Sundaram 1 Reputation point
2020-11-29T22:20:49.723+00:00

Here is my code snippet in a Xamarin xaml form:

            <StackLayout Grid.Row="5" Orientation="Horizontal">
                <Label Text="Gender" FontSize="Small" />
                <RadioButton Text="Male"/>
            </StackLayout>

I have the following in my App constructor

public App()
{
    InitializeComponent();
    Device.SetFlags(new string[] { "RadioButton_Experimental" });
    if (Preferences.ContainsKey("FirstName") && Preferences.ContainsKey("LastName") && Preferences.ContainsKey("Id"))
    {
        LoadPerson();
        LoadEvents();
    }
    else
    {
        Persona = new Person
        {

        };
        LoadPickers();
    }

    MainPage = new OpenPage();

}

I get the following error:

System.TypeLoadException: 'Could not resolve type with token 0100009d from typeref (expected class 'Xamarin.Forms.RadioButton' in assembly 'Xamarin.Forms.Core, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null')'

I am using Xamarin Forms 4.8.0.1687 and Xamarin Essentials 1.5.3.2

is it likely that this particular version of Xamarin Forms is tied to an Android version? I am using Android version 9.0 (Pie)

Any and all help will be appreciated.

Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,324 questions
{count} votes