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

Crash possibly related to Xamarin Forms 4

12 Answers 209 Views
Chat (Conversational UI)
This is a migrated thread and some comments may be shown as answers.
n/a
Top achievements
Rank 1
n/a asked on 30 May 2019, 06:09 PM

Hi,

We have just upgraded to Xamarin Forms 4 and the page containing the Conversational UI throws the following exception when the user backs out to the previous page;

Unhandled managed exception:
Object reference not set to an instance of an object
(System.NullReferenceException)
   at
Telerik.XamarinForms.DataControlsRenderer.iOS.ItemsControlRenderer.OnElementChanged
(Xamarin.Forms.Platform.iOS.ElementChangedEventArgs`1[TElement] e)
[0x00036] in <8e5a228dc72e438d99c2a75ee9177c40>:0
   at
Telerik.XamarinForms.ConversationalUIRenderer.iOS.ChatListViewRenderer.OnElementChanged
(Xamarin.Forms.Platform.iOS.ElementChangedEventArgs`1[TElement] e)
[0x00000] in <0ae6311f3c4d4a12931b84110a04104e>:0
   at
Xamarin.Forms.Platform.iOS.VisualElementRenderer`1[TElement].SetElement
(TElement element) [0x0012a] in <db147fad2aa9412c845ff0ead92dfe20>:0
   at
Xamarin.Forms.Platform.iOS.VisualElementRenderer`1[TElement].Dispose
(System.Boolean disposing) [0x0008c] in
<db147fad2aa9412c845ff0ead92dfe20>:0
   at
Xamarin.Forms.Platform.iOS.ViewRenderer`2[TView,TNativeView].Dispose
(System.Boolean disposing) [0x0005c] in
<db147fad2aa9412c845ff0ead92dfe20>:0
   at Foundation.NSObject.Dispose<…>

 

This doesn't appear to happen on Android (which makes sense as the stack trace runs off into the iOS specific renderer) and happens simply with the presence of the chat control on the page, even when things like the ItemsSource and ItemTemplateSelector are not configured meaning no items are being displayed in the control.

Any help would be much appreciated.

regards,

12 Answers, 1 is accepted

Sort by
0
Lance | Manager Technical Support
Telerik team
answered on 30 May 2019, 06:32 PM
Hello Patrick,

You're absolutely correct, this is related to changes Microsoft made in Xamarin.Forms 4.x and it affects several controls. We are aware of the issues and are working hard to get a service pack out by the end of this week to fix it.

Please subscribe (click the "Follow" button) in this Feedback Portal item to be notified of the progress - Crash when updating to Xamarin.Forms 4.

Regards,
Lance | Technical Support Engineer, Principal
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/a
Top achievements
Rank 1
answered on 30 May 2019, 06:36 PM

Excellent, thanks Lance.

I've worked around it for now by intercepting the renderer with my own renderer and simply eating the error, I'm guessing the worst that can happen is a memory leak and we will simply update as soon as your fixes are in place. This lets us continue to test without issue; unfortunately XF4 fixed a bunch of non Telerik related issues so rolling back simply trades one set of problems for another, or we'd have considered that too.

0
n/a
Top achievements
Rank 1
answered on 04 Jun 2019, 04:53 PM

Hi,

I've updated the Telerik Xamarin library today to version 2019.2.603.1 and am still getting the above crash when using the ConversationalUI. Was this addressed in the Xamarin Forms 4 update or is there more to come?

This is currently blocking a release so any guidance would be appreciated!!

thanks

 

0
Lance | Manager Technical Support
Telerik team
answered on 04 Jun 2019, 07:47 PM
Hi Patrick,

I'm not seeing an exception in the attached test app. Give it a shot on your side to confirm (it will launch to the ChatTestPage).



What I suspect you might be experiencing is Visual Studio didn't entirely replace the assemblies after the update. Try the following and see if it resolves the issue:

Prerequisite. Double check every project's Telerik references/NuGet packages were fully updated to 2019.2.603 package. If not, then complete full update before continuing

1. Close Visual Studio
2. Open the solution in File Explorer
3. Go into every project sub-folder and delete the bin and obj folders
4. Open the solution in Visual Studio again
5. Do a Rebuild Solution

This is the only guaranteed way to be assured that Visual Studio will compile with the latest bits and not skip any assemblies because they're the same name.

Regards,
Lance | Technical Support Engineer, Principal
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/a
Top achievements
Rank 1
answered on 05 Jun 2019, 10:34 AM
Thanks Lance, I'll give that a go now.
0
n/a
Top achievements
Rank 1
answered on 05 Jun 2019, 10:56 AM
Ah, your example doesn't quite cover what I'm seeing, the control works fine until it is "demounted" or whatever it's called when the user backs out to the previous page. I'll put together a base case, see if that replicates it, and attach it.
0
n/a
Top achievements
Rank 1
answered on 05 Jun 2019, 11:25 AM

Hi Lance,

I've got a repro case ready but can't attach it to my post - how should I send it to you?

thanks

0
n/a
Top achievements
Rank 1
answered on 05 Jun 2019, 11:28 AM

Hi,

I've submitted support ticket 1411961 which has the repro case attached.

thanks

 

0
Lance | Manager Technical Support
Telerik team
answered on 05 Jun 2019, 02:42 PM
Hello Patrick,

You did precisely the correct thing with the repro project by opening a Support Ticket (the Xamarin team is already reviewing it). Early indications point to navigation as the cause, however the root cause is still not yet known.

We will follow up with you in the ticket once we know more.

Regards,
Lance | Technical Support Engineer, Principal
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/a
Top achievements
Rank 1
answered on 05 Jun 2019, 04:15 PM
Great, thanks Lance!
0
Casey
Top achievements
Rank 1
answered on 21 Jun 2019, 07:32 PM

Hi,

we have same issue:

 

System.NullReferenceException: Object reference not set to an instance of an object
  at Telerik.XamarinForms.DataControlsRenderer.iOS.ItemsControlRenderer.OnElementChanged (Xamarin.Forms.Platform.iOS.ElementChangedEventArgs`1[TElement] e) [0x00036] in <ec66e7a21530444aaf1ed55e41199e11>:0
  at Telerik.XamarinForms.ConversationalUIRenderer.iOS.ChatListViewRenderer.OnElementChanged (Xamarin.Forms.Platform.iOS.ElementChangedEventArgs`1[TElement] e) [0x00000] in <3f1acee1f16743d28b5498aaa350cd13>:0
  at Xamarin.Forms.Platform.iOS.VisualElementRenderer`1[TElement].SetElement (TElement element) [0x0012a] in <7c3717ccc8b0481ab4edf04001284160>:0
  at Xamarin.Forms.Platform.iOS.VisualElementRenderer`1[TElement].Dispose (System.Boolean disposing) [0x0008c] in <7c3717ccc8b0481ab4edf04001284160>:0
  at Xamarin.Forms.Platform.iOS.ViewRenderer`2[TView,TNativeView].Dispose (System.Boolean disposing) [0x0005c] in <7c3717ccc8b0481ab4edf04001284160>:0
  at Foundation.NSObject.Dispose () [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.8.0.2/src/Xamarin.iOS/Foundation/NSObject2.cs:147
  at Xamarin.Forms.Platform.iOS.VisualElementPackager.Dispose (System.Boolean disposing) [0x0003f] in <7c3717ccc8b0481ab4edf04001284160>:0
  at Xamarin.Forms.Platform.iOS.VisualElementPackager.Dispose () [0x00000] in <7c3717ccc8b0481ab4edf04001284160>:0
  at Xamarin.Forms.Platform.iOS.VisualElementRenderer`1[TElement].Dispose (System.Boolean disposing) [0x00058] in <7c3717ccc8b0481ab4edf04001284160>:0
  at Foundation.NSObject.Dispose () [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.8.0.2/src/Xamarin.iOS/Foundation/NSObject2.cs:147
  at Xamarin.Forms.Platform.iOS.VisualElementPackager.Dispose (System.Boolean disposing) [0x0003f] in <7c3717ccc8b0481ab4edf04001284160>:0
  at Xamarin.Forms.Platform.iOS.VisualElementPackager.Dispose () [0x00000] in <7c3717ccc8b0481ab4edf04001284160>:0
  at Xamarin.Forms.Platform.iOS.VisualElementRenderer`1[TElement].Dispose (System.Boolean disposing) [0x00058] in <7c3717ccc8b0481ab4edf04001284160>:0
  at Foundation.NSObject.Dispose () [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.8.0.2/src/Xamarin.iOS/Foundation/NSObject2.cs:147
  at Xamarin.Forms.Platform.iOS.VisualElementPackager.Dispose (System.Boolean disposing) [0x0003f] in <7c3717ccc8b0481ab4edf04001284160>:0
  at Xamarin.Forms.Platform.iOS.VisualElementPackager.Dispose () [0x00000] in <7c3717ccc8b0481ab4edf04001284160>:0
  at Xamarin.Forms.Platform.iOS.VisualElementRenderer`1[TElement].Dispose (System.Boolean disposing) [0x00058] in <7c3717ccc8b0481ab4edf04001284160>:0
  at Foundation.NSObject.Dispose () [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.8.0.2/src/Xamarin.iOS/Foundation/NSObject2.cs:147
  at Xamarin.Forms.Platform.iOS.VisualElementPackager.Dispose (System.Boolean disposing) [0x0003f] in <7c3717ccc8b0481ab4edf04001284160>:0
  at Xamarin.Forms.Platform.iOS.VisualElementPackager.Dispose () [0x00000] in <7c3717ccc8b0481ab4edf04001284160>:0
  at Xamarin.Forms.Platform.iOS.VisualElementRenderer`1[TElement].Dispose (System.Boolean disposing) [0x00058] in <7c3717ccc8b0481ab4edf04001284160>:0
  at Foundation.NSObject.Dispose () [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.8.0.2/src/Xamarin.iOS/Foundation/NSObject2.cs:147
  at Xamarin.Forms.Platform.iOS.DisposeHelpers.DisposeModalAndChildRenderers (Xamarin.Forms.Element view) [0x00041] in <7c3717ccc8b0481ab4edf04001284160>:0
  at Xamarin.Forms.Platform.iOS.Platform.HandleChildRemoved (System.Object sender, Xamarin.Forms.ElementEventArgs e) [0x0000a] in <7c3717ccc8b0481ab4edf04001284160>:0
  at Xamarin.Forms.Element.OnDescendantRemoved (Xamarin.Forms.Element child) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\Element.cs:619
  at Xamarin.Forms.Element.OnChildRemoved (Xamarin.Forms.Element child) [0x0001f] in D:\a\1\s\Xamarin.Forms.Core\Element.cs:339
  at Xamarin.Forms.VisualElement.OnChildRemoved (Xamarin.Forms.Element child) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\VisualElement.cs:750
  at Xamarin.Forms.Page.OnInternalRemoved (Xamarin.Forms.VisualElement view) [0x00013] in D:\a\1\s\Xamarin.Forms.Core\Page.cs:433
  at Xamarin.Forms.Page.InternalChildrenOnCollectionChanged (System.Object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e) [0x0002c] in D:\a\1\s\Xamarin.Forms.Core\Page.cs:403
  at System.Collections.ObjectModel.ObservableCollection`1[T].OnCollectionChanged (System.Collections.Specialized.NotifyCollectionChangedEventArgs e) [0x00018] in <cfeb875a95684ad09f58680b02e4aa2c>:0
  at System.Collections.ObjectModel.ObservableCollection`1[T].OnCollectionChanged (System.Collections.Specialized.NotifyCollectionChangedAction action, System.Object item, System.Int32 index) [0x00009] in <cfeb875a95684ad09f58680b02e4aa2c>:0
  at System.Collections.ObjectModel.ObservableCollection`1[T].RemoveItem (System.Int32 index) [0x00021] in <cfeb875a95684ad09f58680b02e4aa2c>:0
  at System.Collections.ObjectModel.Collection`1[T].Remove (T item) [0x00027] in <91e0283eca55453fa9b161bf2de4edfd>:0
  at Xamarin.Forms.NavigationPage.Xamarin.Forms.INavigationPageController.RemoveAsyncInner (Xamarin.Forms.Page page, System.Boolean animated, System.Boolean fast) [0x000e7] in D:\a\1\s\Xamarin.Forms.Core\NavigationPage.cs:334
  at Xamarin.Forms.NavigationPage.PopAsyncInner (System.Boolean animated, System.Boolean fast) [0x0004c] in D:\a\1\s\Xamarin.Forms.Core\NavigationPage.cs:308
  at Xamarin.Forms.NavigationPage.PopAsync (System.Boolean animated) [0x00140] in D:\a\1\s\Xamarin.Forms.Core\NavigationPage.cs:190
0
Lance | Manager Technical Support
Telerik team
answered on 21 Jun 2019, 08:10 PM
Hi Casey,

If you're using XF 4.x, then you'll need to update Telerik UI for Xamarin to 2019.2.619 that contains a fix for the renderer disposal issue.

After you update, you will need to do a Clean and Rebuild on each project so that Visual Studio will be forced to build the project with the latest package references. To be completely sure, delete the bin and obj folders from every project before rebuilding.

If you still see a renderer issue after updating, please open a Support Ticket and share a reproducible so that I can escalate it to the development team.

Regards,
Lance | Technical Support Engineer, Principal
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
Chat (Conversational UI)
Asked by
n/a
Top achievements
Rank 1
Answers by
Lance | Manager Technical Support
Telerik team
n/a
Top achievements
Rank 1
Casey
Top achievements
Rank 1
Share this question
or