This is a migrated thread and some comments may be shown as answers.
Error Debugging latest 2016 Q2 SDKBrowser on Android device (Galaxy S4)
3 Answers 7 Views
This is a migrated thread and some comments may be shown as answers.
Jes
Top achievements
Rank 1
Jes asked on 24 May 2016, 06:47 AM

When trying to debug on android device I am getting a series of cast exceptions when debugging the sample .  The app runs ok on the device when not debugging.

Anyone got any ideas on what might be the cause of this?

System.InvalidCastException: Unable to convert instance of type 'Telerik.XamarinForms.InputRenderer.Android.DataForm.ValidationCompletedListener' to type 'com/telerik/widget/dataform/visualization/core/EntityPropertyEditor'.
System.InvalidCastException: Unable to convert instance of type 'Telerik.XamarinForms.InputRenderer.Android.DataForm.ValidationCompletedListener' to type 'com/telerik/widget/dataform/visualization/core/EntityPropertyEditor'.
System.InvalidCastException: Unable to convert instance of type 'Telerik.XamarinForms.InputRenderer.Android.DataForm.ValidationCompletedListener' to type 'com/telerik/widget/dataform/visualization/core/EntityPropertyEditor'.
System.InvalidCastException: Unable to convert instance of type 'Telerik.XamarinForms.InputRenderer.Android.DataForm.ValidationCompletedListener' to type 'com/telerik/widget/dataform/visualization/core/EntityPropertyEditor'.
System.InvalidCastException: Unable to convert instance of type 'Telerik.XamarinForms.InputRenderer.Android.DataForm.ValidationCompletedListener' to type 'com/telerik/widget/dataform/visualization/core/EntityPropertyEditor'.
System.InvalidCastException: Unable to convert instance of type 'Com.Telerik.Widget.Dataform.Visualization.Editors.DataFormTextEditor' to type 'com/telerik/widget/dataform/visualization/editors/DataFormSeekBarEditor'.
System.InvalidCastException: Unable to convert instance of type 'Com.Telerik.Widget.Dataform.Visualization.Editors.DataFormTextEditor' to type 'com/telerik/widget/dataform/visualization/editors/DataFormSpinnerEditor'.
System.InvalidCastException: Unable to convert instance of type 'Com.Telerik.Widget.Dataform.Visualization.Editors.DataFormTextEditor' to type 'com/telerik/widget/dataform/visualization/editors/DataFormDateEditor'.
System.InvalidCastException: Unable to convert instance of type 'Com.Telerik.Widget.Dataform.Visualization.Editors.DataFormTextEditor' to type 'com/telerik/widget/dataform/visualization/editors/DataFormTimeEditor'.
System.InvalidCastException: Unable to convert instance of type 'Android.Widget.EditText' to type 'com/telerik/widget/numberpicker/RadNumberPicker'.
System.InvalidCastException: Unable to convert instance of type 'Com.Telerik.Widget.Dataform.Visualization.Editors.DataFormTextEditor' to type 'com/telerik/widget/dataform/visualization/editors/DataFormIntegerEditor'.
System.InvalidCastException: Unable to convert instance of type 'Com.Telerik.Widget.Dataform.Visualization.Editors.DataFormTextEditor' to type 'com/telerik/widget/dataform/visualization/editors/DataFormDecimalEditor'.

3 Answers, 1 is accepted

Sort by
0
Ves
Telerik team
answered on 27 May 2016, 08:07 AM
Hi Jes,

I am afraid we are not aware of such problems and our local tests with the same device (Samsung Galaxy S4) did not reproduce them. Generally, such issue might be caused by lack of synchronization. You may try to uninstall the app using the device Application Manager and then try to run it again. In addition, can you please check the Android SDK versions you have installed as well as the build options of the project -- compile and target SDK version.

Best regards,
Ves
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Adrian
Top achievements
Rank 1
answered on 16 Oct 2016, 08:34 AM

I have the same problem as Jes. It's very easy to reproduce, just create a new telerik xamarin forms project with the telerik wizard and add a RadDataForm like this: 

 

<input:RadDataForm x:Name="DataForm" HorizontalOptions="Fill" VerticalOptions="Fill">
      <input:RadDataForm.Source>
        <viewModels:LoginPageViewModel />
      </input:RadDataForm.Source>
    </input:RadDataForm>

 

Also, add a viewmodel like this: 

 

public class LoginPageViewModel:PageViewModelBase
    {
        public LoginPageViewModel()
        {
            
        }

        [DisplayOptions(Header = "Login", Position = 0)]
        [EmailValidator("Dies ist kein gültiger Login.")]
        [NonEmptyValidator("Login fehlt")]
        public string Login { get; set; } = "me@here.com";

        [DisplayOptions(Header = "Passwort",Position=1)]
        [NonEmptyValidator("Passwort fehlt")]
        public string Password { get; set; }

}

Note that the exceptions are caught, which might be the reason why you might not have noticed them. If you set your vs exception settings so that the debugger breaks on caught CLR exceptions, you will notice that the debugger breaks multiple times. 

 

0
Ves
Telerik team
answered on 20 Oct 2016, 06:18 AM
Hi Adrian,

Thanks for the details. Indeed, these exceptions are caught in a catch block. Do these interfere somehow with your development process or app requirements? In order to get them out of your way, you can uncheck System.InvalidCastException in Exception Settings window. Meanwhile, we will review the possibilities to refactor the code in order to avoid these try-catch blocks.

Best regards,
Ves
Telerik by Progress
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Asked by
Jes
Top achievements
Rank 1
Answers by
Ves
Telerik team
Adrian
Top achievements
Rank 1
Share this question
or