Error Debugging latest 2016 Q2 SDKBrowser on Android device (Galaxy S4)

4 posts, 0 answers
  1. Jes
    Jes avatar
    1 posts
    Member since:
    Apr 2014

    Posted 24 May Link to this post

    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'.

  2. Ves
    Admin
    Ves avatar
    2879 posts

    Posted 27 May Link to this post

    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
  3. DevCraft banner
  4. Adrian
    Adrian avatar
    2 posts
    Member since:
    Nov 2015

    Posted 16 Oct Link to this post

    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. 

     

  5. Ves
    Admin
    Ves avatar
    2879 posts

    Posted 20 Oct Link to this post

    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
Back to Top
DevCraft banner