This is a migrated thread and some comments may be shown as answers.

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

11 Answers 204 Views
ListView
This is a migrated thread and some comments may be shown as answers.
Namysław
Top achievements
Rank 1
Namysław asked on 10 Jul 2017, 11:27 AM
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.

11 Answers, 1 is accepted

Sort by
0
Namysław
Top achievements
Rank 1
answered on 12 Jul 2017, 07:57 AM
Any response from support? It's crashing my whole app from time to time...
0
Tsvyatko
Telerik team
answered on 13 Jul 2017, 10:09 AM
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
0
Namysław
Top achievements
Rank 1
answered on 14 Jul 2017, 10:06 AM
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.
0
Tsvyatko
Telerik team
answered on 18 Jul 2017, 03:55 PM
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
0
Namysław
Top achievements
Rank 1
answered on 19 Jul 2017, 07:09 AM
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.
0
Tsvyatko
Telerik team
answered on 21 Jul 2017, 01:55 PM
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
0
N Mackay
Top achievements
Rank 1
answered on 24 Jul 2017, 03:10 PM

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.

 

 

0
Tsvyatko
Telerik team
answered on 24 Jul 2017, 03:20 PM
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
0
N Mackay
Top achievements
Rank 1
answered on 24 Jul 2017, 04:15 PM

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.

0
Zahid
Top achievements
Rank 1
answered on 25 Sep 2018, 04:54 PM

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.

0
Lance | Manager Technical Support
Telerik team
answered on 26 Sep 2018, 06:36 PM
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
Tags
ListView
Asked by
Namysław
Top achievements
Rank 1
Answers by
Namysław
Top achievements
Rank 1
Tsvyatko
Telerik team
N Mackay
Top achievements
Rank 1
Zahid
Top achievements
Rank 1
Lance | Manager Technical Support
Telerik team
Share this question
or