Under Review
Last Updated: 09 Mar 2021 07:45 by ADMIN
Vlad
Created on: 03 Mar 2021 17:25
Category: UI for Xamarin
Type: Bug Report
3
Errors with latest versions of AndroidX

There seems to be 2 issues with Telerik ui for xamarin and Xamarin.AndroidX.Core versions 1.3.2.2 and newer where A) Linker seems to be failing when set to "Sdk Assemblies Only" on Visual Studio 16.9.0.

 

The other issue is with Telerik RadListView and same  AndroidX.Core at runtime I am getting the following exception:

System.TypeLoadException: 'VTable setup of type Telerik.XamarinForms.DataControlsRenderer.Android.ListViewAccessibilityDelegateCompat failed'

 

Please advise

5 comments
ADMIN
Didi
Posted on: 09 Mar 2021 07:45

Hello

We have researched the case and found the reason for the exception. The exception is caused by namespace renaming in the latest Xamarin.AndroidX.Core package. The issue is a typo, which Xamatin.Forms fixed, but this is a breaking change, as now the namespace is different. Here is the link https://github.com/xamarin/AndroidX/commit/b64834625ba231d89afb9c89bdae007a7258eca0#diff-64d65877e1b5eb3de016e98941c7020707c9b317946c38a0e63972fab41e1984   

So as we are built against an earlier version of the NuGet this breaking change (namespace renaming) leads to us not being able to find all classes in that namespace as they are now in different one.

The issue happens in Xamarin.AndroidX.Core package version 1.3.2.2 or higher. Also if you use another Xamarin.AndroidX package which depends on Xamarin.AndroidX.Core 1.3.2.2 version or higher.

Solution:

The solution is to downgrade the Xamarin.AndroidX.Core package to version to 1.3.2.1. Also, you may need to downgrade other packages like Xamarin.AndroidX.Media, Xamarin.Google.Android.Material, etc. as they depend on the Xamarin.AndroidX.Core package.

Regards,
Didi
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Juri
Posted on: 04 Mar 2021 21:05

I also have the same issue. After applying the suggested workaround I started getting the following error:

Mono.Linker.MarkException: Error processing method: 'System.Void AndroidX.RecyclerView.Widget.RecyclerView/LayoutManager::n_OnInitializeAccessibilityNodeInfo_Landroidx_recyclerview_widget_RecyclerView_Recycler_Landroidx_recyclerview_widget_RecyclerView_State_Landroidx_core_view_accessibility_AccessibilityNodeInfoCompat_(System.IntPtr,System.IntPtr,System.IntPtr,System.IntPtr,System.IntPtr)' in assembly: 'Xamarin.AndroidX.RecyclerView.dll' ---> Mono.Cecil.ResolutionException: Failed to resolve AndroidX.Core.View.Accessibility.AccessibilityNodeInfoCompat
   at Mono.Linker.Steps.MarkStep.HandleUnresolvedType(TypeReference reference)
   at Mono.Linker.Steps.MarkStep.MarkType(TypeReference reference)
   at MonoDroid.Tuner.MonoDroidMarkStep.MarkType(TypeReference reference)
   at Mono.Linker.Steps.MarkStep.MarkMethodBody(MethodBody body)
   at Mono.Linker.Steps.MarkStep.ProcessMethod(MethodDefinition method)
   at Mono.Linker.Steps.MarkStep.ProcessQueue()
   --- End of inner exception stack trace ---
   at Mono.Linker.Steps.MarkStep.ProcessQueue()
   at Mono.Linker.Steps.MarkStep.ProcessPrimaryQueue()
   at Mono.Linker.Steps.MarkStep.Process()
   at Mono.Linker.Steps.MarkStep.Process(LinkContext context)
   at MonoDroid.Tuner.MonoDroidMarkStep.Process(LinkContext context)
   at Mono.Linker.Pipeline.ProcessStep(LinkContext context, IStep step)
   at Mono.Linker.Pipeline.Process(LinkContext context)
   at MonoDroid.Tuner.Linker.Process(LinkerOptions options, ILogger logger, LinkContext& context)
   at Xamarin.Android.Tasks.LinkAssemblies.Execute(DirectoryAssemblyResolver res)
   at Xamarin.Android.Tasks.LinkAssemblies.RunTask()
   at Xamarin.Android.Tasks.AndroidTask.Execute()

----------------------------------------------------------------------------------

My workaround for this is to set Linking to "None". After setting Linking to None the project compiles and runs in the debug mode. However I need this to be fixed ASAP. Please advise.

 

ADMIN
Didi
Posted on: 04 Mar 2021 10:31

Hello,

The issue can be reproduced when using Xamarin.AndroidX.Core version 1.3.2.2 . If you Downgrade the Xamarin.AndroidX.Core version to 1.3.2.1  the exceptions below cannot be reproduced. The project builds and runs as expected 

Exception in ListView:
System.TypeLoadException: 'VTable setup of type Telerik.XamarinForms.DataControlsRenderer.Android.ListViewAccessibilityDelegateCompat failed'

Exception in NumericInpit:
System.TypeLoadException
  Message=VTable setup of type Telerik.XamarinForms.Common.Android.HelpTextAccessibilityDelegateCompat failed

Exception in DateTimePicker because of the TabView control.. in other pickers exception cannot be reproduced
System.TypeLoadException
  Message=VTable setup of type Telerik.XamarinForms.Common.Android.HelpTextAccessibilityDelegateCompat failed
Exception in TreeView:
System.TypeLoadException: 'VTable setup of type Telerik.XamarinForms.DataControlsRenderer.Android.TreeViewAccessibilityDelegateCompat failed'

The development team is researching the case. Once we have more information to share we will send a follow-up message in this thread.

Workaround: 

1 option: If you are using Xamarin.Google.Android.Material version 1.3.0.1-> downgrade to Xamarin.Google.Android.Material version 1.2.1.1. it will automatically downgrade the versions of the AndroidX packages it depends on (also the Xamarin.AndroidX.Core version)

2 option If you are not using the Material package, just using AndoridX.Core package -> Downgrade the Xamarin.AndroidX.Core version to 1.3.2.1. 

Regards,
Didi
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Vlad
Posted on: 03 Mar 2021 18:57

Hi Lance, Thank you for your prompt reply. My linker setting is the following:

The Link SDK Assemblies option only links assemblies that come with Xamarin.Android. All other assemblies (such as your code) are not linked.

I thought this was the right linker setting that will not touch Telerik assemblies.

ADMIN
Lance | Manager Technical Support
Posted on: 03 Mar 2021 18:53

Hi Vlad,

Thank you for sharing the details, let me get right to the issues.

The first problem - This is expected.

This is because we do not support the use of the Linker to strip out Telerik code. You need to leave Android and iOS linker to include 3rd party assemblies.

The only place you can use the native linker is on UWP. This is because you are forced to use .NETNative and Xamarin has a way to deal with it by adding the types to the XamarinForms AssembliesToInclude list (see this real-world demo usage).

 If you want to decrease the size of your app, you can reference just the bare minimum necessary for the controls/feature you're using.

The 2nd problem - We are currently investigating.

I will forward this ticket to Didi, who is working with the team. She will follow up as soon as we know more.

 

Thank you for your patience and understanding while we work towards finding the root cause of the ListViewAccessibilityDelegateCompat error.

Regards,
Lance | Manager Technical Support
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.