Using of RadListView is crashing whole app, from time to time

12 posts, 0 answers
  1. Namysław
    Namysław avatar
    44 posts
    Member since:
    Jul 2017

    Posted 10 Jul 2017 Link to this post

    Using of RadListView is crashing whole app, from time to time.
    There is no exact reproduciable way, I'm using same set of data, and from time to time, while navigating to given page (that contains RadListView in UI), it's crashing whole app, with below stacktrace:

    Xamarin caused by: android.runtime.JavaProxyThrowable: System.ArgumentException: Handle must be valid.
    Parameter name: instance
    Java.Interop.JniEnvironment.InstanceMethods.CallNonvirtualVoidMethod(JniObjectReference instance, JniObjectReference type, JniMethodInfo method, JniArgumentValue* args)<bd30a18775d94dc8b6263aecd1ca9077>:0
    Android.Runtime.JNIEnv.CallNonvirtualVoidMethod(IntPtr jobject, IntPtr jclass, IntPtr jmethod, JValue* parms)<d855bac285f44dda8a0d8510b679b1e2>:0
    Com.Telerik.Widget.List.RadListView.RemoveBehavior(ListViewBehavior p0)<460da158265f4a9ab30bfc20f66f4cef>:0
    Telerik.XamarinForms.DataControlsRenderer.Android.ListViewRenderer.ClearBehaviors(RadListView oldControl)<c7cf335427f34b76a978796372f68e8d>:0
    Telerik.XamarinForms.DataControlsRenderer.Android.ListViewRenderer.OnElementDetached(RadListView oldElement)<c7cf335427f34b76a978796372f68e8d>:0
    Telerik.XamarinForms.Common.Android.AndroidRendererBase<S, T>.Dispose(bool disposing)<f447797ad1b04dc48aa8741bf7f44749>:0
    Java.Lang.Object.Finalize()<d855bac285f44dda8a0d8510b679b1e2>:0

    Sometimes it's crashing while adding/removing items behind list collection, and REFRESHING whole list - initializing new ObservableCollection with new objects set.

    It's totally random crashing - it's crashing once per 20-30 doing the same clicking through app.
  2. Namysław
    Namysław avatar
    44 posts
    Member since:
    Jul 2017

    Posted 12 Jul 2017 Link to this post

    Any response from support? It's crashing my whole app from time to time...
  3. Tsvyatko
    Admin
    Tsvyatko avatar
    863 posts

    Posted 13 Jul 2017 Link to this post

    Hi Namyslaw,

    Thank you for contacting us! Based on the provided information we are unable to reproduce. If you could share more details on the navigation you are using (ideally a stripped down project) it will help us to fast isolate and address the issue.

    Meanwhile based on the stacktrace I can suggest the following workaround:
    [assembly: ExportRenderer(typeof(Telerik.XamarinForms.DataControls.RadListView), typeof(CustomListRenderer))] 
      
     public class CustomListRenderer : ListViewRenderer
        {
            protected override void OnElementChanged(ElementChangedEventArgs<ListView> e)
            {
                try
                {
                    base.OnElementChanged(e);
                }
                catch (ArgumentException ex)
                {
                }
            }
      
            protected override void Dispose(bool disposing)
            {
                try
                {
                    base.Dispose(disposing);
                }
                catch (ArgumentException ex)
                {
                }
            }
        }




    Regards,
    Tsvyatko
    Progress 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
  4. Namysław
    Namysław avatar
    44 posts
    Member since:
    Jul 2017

    Posted 14 Jul 2017 Link to this post

    Thanks a lot. I've just introduced your workaround, to catch **ArgumentException**, but with running debbuger I was not able to reproduce it again.
    However, in meanwhile, there was completelly new exception, but surely related to it, so I've just override **OnElementPropertyChanged** to catch **ArgumentException** also there...

    Xamarin caused by: android.runtime.JavaProxyThrowable: System.ArgumentException: Handle must be valid.
    Parameter name: instance
    Java.Interop.JniEnvironment.InstanceMethods.CallNonvirtualObjectMethod(JniObjectReference instance, JniObjectReference type, JniMethodInfo method)<bd30a18775d94dc8b6263aecd1ca9077>:0
    Android.Runtime.JNIEnv.CallNonvirtualObjectMethod(IntPtr jobject, IntPtr jclass, IntPtr jmethod)<d855bac285f44dda8a0d8510b679b1e2>:0
    Android.Support.V7.Widget.RecyclerView.GetAdapter()<00ef854e109241db9d853f1dd4d69cd9>:0
    Telerik.XamarinForms.DataControlsRenderer.Android.ListViewAdapter.UpdateItemsSource(RadListView sourceOwner, RadListView targetOwner)<c7cf335427f34b76a978796372f68e8d>:0
    Telerik.XamarinForms.DataControlsRenderer.Android.ListViewAdapter.UpdateCore(RadListView sourceOwner, RadListView targetOwner, string propertyName)<c7cf335427f34b76a978796372f68e8d>:0
    Telerik.XamarinForms.Common.FacadeAdapterBase<S, T>.Update(object sourceOwner, object targetOwner, string propertyName, object sourceOwnerRoot, object targetOwnerRoot)<f447797ad1b04dc48aa8741bf7f44749>:0
    at Telerik.XamarinForms.Common.XamarinToNativeControlExtensions.Update[T,K] (T nativeElement, K xfЕlement, System.String propertyName, System.Object sourceOwnerRoot, System.Object targetOwnerRoot) [0x00031] in <f447797ad1b04dc48aa8741bf7f44749>:0
    Telerik.XamarinForms.DataControlsRenderer.Android.ListViewRenderer.OnElementPropertyChanged(object sender, PropertyChangedEventArgs e)<c7cf335427f34b76a978796372f68e8d>:0
    <Module>.invoke_void_object_PropertyChangedEventArgs(object, PropertyChangedEventArgs)(wrapper delegate-invoke)
    Xamarin.Forms.BindableObject.OnPropertyChanged(string propertyName)
    Xamarin.Forms.Element.OnPropertyChanged(string propertyName)
    Xamarin.Forms.BindableObject.SetValueActual(BindableProperty property, BindableObject.BindablePropertyContext context, object value, bool currentlyApplying, SetValueFlags attributes, bool silent)
    Xamarin.Forms.BindableObject.SetValueCore(BindableProperty property, object value, SetValueFlags attributes, BindableObject.SetValuePrivateFlags privateAttributes)
    Xamarin.Forms.BindingExpression.ApplyCore(object sourceObject, BindableObject target, BindableProperty property, bool fromTarget)
    Xamarin.Forms.BindingExpression.Apply(bool fromTarget)
    Xamarin.Forms.BindingExpression.BindingExpressionPart.<PropertyChanged>b__47_0()
    Java.Lang.Thread.RunnableImplementor.Run()<d855bac285f44dda8a0d8510b679b1e2>:0
    Java.Lang.IRunnableInvoker.n_Run(IntPtr jnienv, IntPtr native__this)<d855bac285f44dda8a0d8510b679b1e2>:0
    at (wrapper dynamic-method) System.Object:4865c689-d64f-493f-9b7b-498898c8b0e2 (intptr,intptr)
    mono.java.lang.RunnableImplementor.n_run(Native Method)
    mono.java.lang.RunnableImplementor.run()RunnableImplementor.java:30
    android.os.Handler.handleCallback()Handler.java:751
    android.os.Handler.dispatchMessage()Handler.java:95
    android.os.Looper.loop()Looper.java:154
    android.app.ActivityThread.main()ActivityThread.java:6186
    java.lang.reflect.Method.invoke(Native Method)
    com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run()ZygoteInit.java:889
    com.android.internal.os.ZygoteInit.main()ZygoteInit.java:779

    Will update you, when I'll be able to reproduce it again, but it's really hard.
  5. Tsvyatko
    Admin
    Tsvyatko avatar
    863 posts

    Posted 18 Jul 2017 Link to this post

    Hello Namyslaw,

    We will try to apply blind fix for this issue in our next internal build. However any information regarding this issue will be very helpful to isolate and ensure the issue will not longer occur.

    Regards,
    Tsvyatko
    Progress 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
  6. Namysław
    Namysław avatar
    44 posts
    Member since:
    Jul 2017

    Posted 19 Jul 2017 Link to this post

    It's realllly hard to reproduce it, that's the first point. The second point is - my Xamarin project is too big, and the time pressure is too high, to be able to extract only needed things from project, in order to send you reproducible project pack.

    Hope, that yours next build will fix that. If no, then I'll try to extract needed code.
  7. Tsvyatko
    Admin
    Tsvyatko avatar
    863 posts

    Posted 21 Jul 2017 Link to this post

    Hi Namyslaw,

    We have issued a build today. Let us know if the new version resolves the issue.

    Regards,
    Tsvyatko
    Progress 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
  8. N Mackay
    N Mackay avatar
    250 posts
    Member since:
    Dec 2010

    Posted 24 Jul 2017 Link to this post

    Hi,

    I reported this issue via a ticket as well.

    Is it resolved in the latest nuget version?

    I don't see any reference in the release notes.

    http://www.telerik.com/versionnotes.aspx?id=4977

    Thanks.

     

     

  9. Tsvyatko
    Admin
    Tsvyatko avatar
    863 posts

    Posted 24 Jul 2017 Link to this post

    Hello Norman,
    I can confirm that we have applied the blind fix for the issue. We have not added it in the release notes as we are uncertain that the fix will have effect.

    Let us know if you've tried the updated version.

    Regards,
    Tsvyatko
    Progress 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
  10. N Mackay
    N Mackay avatar
    250 posts
    Member since:
    Dec 2010

    Posted 24 Jul 2017 in reply to Tsvyatko Link to this post

    We're patching it as I type.

    I'll feedback if we're getting use issues on page tear-down with Radlist in Android.

    As the framework code & modules are shared over several apps it takes a little while.

    Thanks.

  11. Zahid
    Zahid avatar
    1 posts
    Member since:
    Jul 2018

    Posted 25 Sep 2018 in reply to N Mackay Link to this post

    Hi Mackay,

    I am also facing similar kind of issue. Did you figure out any solution or workaround?
    Please let me know. Appreciate it.

    Zahid.

  12. Lance | Manager Technical Support
    Admin
    Lance | Manager Technical Support avatar
    1195 posts

    Posted 26 Sep 2018 Link to this post

    Hello Zahid,

    The exception you were getting was due to Xamarin.Forms rendering of Android TextView. This appears to have been fixed as of Xamarin.Forms 3.2.0.729530-pre2.

    Regards,
    Lance | Tech Support Engineer, Sr.
    Progress 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
Back to Top