question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Radio Button System.TypeInitializationException

See original GitHub issue

I 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:closed
  • Created 4 years ago
  • Comments:14 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
cortensingercommented, Apr 24, 2019

Same problem on my end…switched to CheckBoxes in the time being

1reaction
enisncommented, Apr 27, 2019

@zalza13 oh yes, sorry about it. It haven’t been published yet.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Not sure why this Radio Button is throwing an error?
I have set up my code so a message box appears if the Member ID you have entered is already registered to the...
Read more >
[Solved]-How do I make and if else statement for individual radio ...
Based on your comments, I suggest using a regular Button instead of the RadioButton . Here is an implementation to display a unique...
Read more >
RadioButton Class (System.Windows.Controls)
Represents a button that can be selected, but not cleared, by a user. The IsChecked property of a RadioButton can be set by...
Read more >
System.TypeInitializationException - WHEN WILL THIS BE ...
System.TypeInitializationException - WHEN WILL THIS BE FIXED · Right-click anywhere in the folder. · Tap Properties. · Go to the Security tab.
Read more >
RadioButton Class (System.Windows.Forms)
Enables the user to select a single option from a group of choices when paired with other RadioButton controls.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found