Xamarin forms Error displaying SideDraw on ios device, works in simulator

1 Answer 205 Views
SideDrawer - Xamarin.iOS
Top achievements
Rank 1
Steven asked on 24 Jun 2021, 02:12 PM

An error occurred: 'Object reference not set to an instance of an object.'. Callstack: '  at Telerik.XamarinForms.PrimitivesRenderer.iOS.SideDrawerRenderer.OnElementAttached (Telerik.XamarinForms.Primitives.RadSideDrawer newElement) <0x103c213b8 + 0x00054> in <3815ecfd73d84df698419fd5cca8ff43>:0 
  at Telerik.XamarinForms.Common.iOS.IosRendererBase`2[S,T].OnElementChanged (Xamarin.Forms.Platform.iOS.ElementChangedEventArgs`1[TElement] e) <0x112c3a4f0 + 0x00062> in <e4beb37b571e46a0993fb50802f2986c>:0 


I get this error on Iphone 5s & Ipad mini with the demo code for sidedraw


<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"

    <telerikPrimitives:RadSideDrawer x:Name="drawer" DrawerLength="200">
            <Label Text="Main content" />
            <Label Text="Drawer content" />

Top achievements
Rank 1
commented on 24 Jun 2021, 02:19 PM

Forgot to add this is using VS on windows (VS,XCode,Telerik all latest versions)
Telerik team
commented on 28 Jun 2021, 01:33 PM

I am not able to reproduce this error, so I would need more details on the concrete setup you have.  How do you reference the Telerik assemblies?  Do you add the needed references inside the iOS project as well - if it's the Telerik.UI.for.Xamarin nuget, it should be installed in the iOS project, if you manually add assemblies, you should add the ones from the iOS folder.  Do you use the latest release of Telerik UI for Xamarin? Any additional information you could provide would be of help.

1 Answer, 1 is accepted

Sort by
Top achievements
Rank 1
answered on 28 Jun 2021, 01:39 PM

I raised this question as a ticket and got this reply. Apparently some of the Telerik controls don't work if you use hot restart.


Are you using VS 2019 PC Hot Restart? If yes, the crash is expected behavior because Hot Restart is not currently support with static iOS libraries. This is an unfortunate limitation of Microsoft's Hot Restart feature that we have no control over.

UI for Xamarin uses static libraries for native iOS controls like the SideDrawer. The reason the RadBorder works is because it is a pure Xamarin.Forms-based control (we use SkiaSharp for rendering). 

> If you want to see what is a control that comes form the static native libraries, you can review the native UI for Xamarin.iOS wrappers documentation.


To work around this limitation, plug the iPhone into the Mac and rebuild the project then deploy/debug through the Mac.

SideDrawer - Xamarin.iOS
Asked by
Top achievements
Rank 1
Answers by
Top achievements
Rank 1
Share this question