Radio Button System.TypeInitializationException
See original GitHub issueI have recently started having an issue with radio buttons. I am using vs2019. I have implemented the nugget with the exact code from the documentation and i get the following exception. I have been using the nugget for 6-8 months and it has worked wonderfully. Since the update to vs2019 and the update to 3.0.8. This issue has occurred. It occurs on iOS and Android. The other controls seem to work fine, it just seems to happen when i implement Radio Buttons.
Thanks!
<input:RadioButtonGroupView>
<input:RadioButton Text="Option 1" />
<input:RadioButton Text="Option 2" />
<input:RadioButton Text="Option 3" />
<input:RadioButton Text="Option 4" />
</input:RadioButtonGroupView>
Here is the InnerException i am receiving.
{System.ArgumentException: Default value did not match return type Parameter name: defaultValue at Xamarin.Forms.BindableProperty…ctor (System.String propertyName, System.Type returnType, System.Type declaringType, System.Object defaultValue, Xamarin.Forms.BindingMode defaultBindingMode, Xamarin.Forms.BindableProperty+ValidateValueDelegate validateValue, Xamarin.Forms.BindableProperty+BindingPropertyChangedDelegate propertyChanged, Xamarin.Forms.BindableProperty+BindingPropertyChangingDelegate propertyChanging, Xamarin.Forms.BindableProperty+CoerceValueDelegate coerceValue, Xamarin.Forms.BindableProperty+BindablePropertyBindingChanging bindingChanging, System.Boolean isReadOnly, Xamarin.Forms.BindableProperty+CreateDefaultValueDelegate defaultValueCreator) [0x0008d] in D:\a\1\s\Xamarin.Forms.Core\BindableProperty.cs:77 at Xamarin.Forms.BindableProperty.Create (System.String propertyName, System.Type returnType, System.Type declaringType, System.Object defaultValue, Xamarin.Forms.BindingMode defaultBindingMode, Xamarin.Forms.BindableProperty+ValidateValueDelegate validateValue, Xamarin.Forms.BindableProperty+BindingPropertyChangedDelegate propertyChanged, Xamarin.Forms.BindableProperty+BindingPropertyChangingDelegate propertyChanging, Xamarin.Forms.BindableProperty+CoerceValueDelegate coerceValue, Xamarin.Forms.BindableProperty+CreateDefaultValueDelegate defaultValueCreator) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\BindableProperty.cs:137 at Plugin.InputKit.Shared.Controls.RadioButton…cctor () [0x003cf] in <xxxxxxxxxxxxxxxxxxx>:0 }
Here is the StackTrace
" at OrangeSheets.MainPage…ctor () [0x00008] in /Users/XXXX/Projects/XXXXX/XXXXXXXX/MainPage.xaml.cs:18 \n at XXXXX.App…ctor () [0x0000f] in /Users/XXXX/Projects/XXXX/XXXX/App.xaml.cs:13 \n at XXXX.Droid.MainActivity.OnCreate (Android.OS.Bundle savedInstanceState) [0x00037] in /Users/XXXX/Projects/XXX/XXXXX.Android/MainActivity.cs:28 \n at Android.App.Activity.n_OnCreate_Landroid_os_Bundle_ (System.IntPtr jnienv, System.IntPtr native__this, System.IntPtr native_savedInstanceState) [0x00011] in <2960acf2eeb24d88b5230e1e8afbdc2e>:0 \n at (wrapper dynamic-method) Android.Runtime.DynamicMethodNameCounter.8(intptr,intptr,intptr)"
Issue Analytics
- State:
- Created 4 years ago
- Comments:14 (2 by maintainers)

Top Related StackOverflow Question
Same problem on my end…switched to CheckBoxes in the time being
@zalza13 oh yes, sorry about it. It haven’t been published yet.