Declined
Last Updated: 19 Mar 2020 10:15 by ADMIN
Nadya
Created on: 19 Feb 2020 17:08
Category: UI for Xamarin
Type: Bug Report
6
RecyclerView Problem on AndroidX

If you have a project that has a dependency on: Xamarin.AndroidX.RecyclerView

It will cause a Release build failure due to Telerik.XamarinForms.DataControls using the wrong type in the renderer (AndroidX's RecyclerView instead of v7.Widgets's RecyclerView).

Here is the build error clarifying that it cannot find a `HasStableIds` property/method:

Error Mono.Linker.MarkException: Error processing method: 'System.Void Telerik.XamarinForms.DataControlsRenderer.Android.ItemsControlRenderer::OnElementAttached(Telerik.XamarinForms.DataControls.ItemsControl)' in assembly: 'Telerik.XamarinForms.DataControls.dll' ---> Mono.Cecil.ResolutionException: Failed to resolve System.Void AndroidX.RecyclerView.Widget.RecyclerView/Adapter::set_HasStableIds(System.Boolean)

Reproduce

You can use the attached project to reproduce the problem. Be sure to have the following settings:

  • Build in Release configuration
  • Set LinkerBehavior to SDK assemblies Only

Workaround

Uninstall Xamarin.AndroidX.RecyclerView

9 comments
ADMIN
Yana
Posted on: 19 Mar 2020 10:15

Hello Art,

Our next minor release, expected at the end of this week or early next week, will address the issues with Android X.  Please follow the referred earlier feature request to receive an email notification when the release is available.

Regards,
Yana
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
Art
Posted on: 18 Mar 2020 15:04
So, is there a solution to this?  Xamarin.Forms 4.5 is out now and I upgraded.  But, I still see this error.  I looked at the posts that are linked to this thread and it seems that there are no definitely solutions.  Some people tried things that work that didn't work for other people.  So, is the next update of Telerik going to address this issue?
ADMIN
Yana
Posted on: 28 Feb 2020 12:02

Hello Cherchali,

Sorry to hear you've come across this issue.

There is a separate feature request for providing support for AndroidX, you can follow its status here: https://feedback.telerik.com/xamarin/1455433-provide-support-for-androidx

As the next release of Xamarin.Forms (4.5) is going to be using AndroidX references, we will be treating this request with very high priority so that we can release UI for Xamarin with XF 4.5 support.

Until this is resolved, the only solution is to use XF 4.4 (and downgrade any Plugin packages) to make sure that you're not accidentally pulling in AndroidX references.

Regards,
Yana
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
CHERCHALI
Posted on: 28 Feb 2020 06:24

Hi,

just happened today, I have the same issue after upgrading to XF 4.5 w/ AndroidX.

ADMIN
Yana
Posted on: 26 Feb 2020 15:25

Hello guys,

I wanted to give a quick update on this.  Xamarin team fixed the discussed issue on their side: https://github.com/xamarin/AndroidX/issues/58

Still, we cannot claim support for AndroidX at this stage.  I logged a separate feature request in our public feedback portal regarding this, you can track its status and post any comments at the link below:

Provide support for AndroidX

If you have any additional questions, let us know.

Regards,
Yana
Progress Telerik

ADMIN
Lance | Senior Manager Technical Support
Posted on: 20 Feb 2020 22:31

Hello Vitaly,

After reviewing the AndroidX dependencies of Xamarin.Forms 4.5.0.282-pre4, I can confirm that the dependency tree eventually pulls in the AndroidX RecyclerView

Until there is a solution for this, I can think of only two options

  • Option 1 - Set the LinkerBehavior to None
  • Option 2 - Use Android 9 and XF 4.4

Regards,
Lance | Team Lead - US DevTools Support
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
ADMIN
Lance | Senior Manager Technical Support
Posted on: 20 Feb 2020 21:42

Hi Vitaly,

You don't have to have an explicit reference to AndroidX. It could be a dependency oif something you're using. If the only change you made was to update XF to 4.5, then I suspect it might be a dependency in there.

For Nadya, it was a dependency on another package (Plugins). The fix was to drop the Plugins version back until it didn't require AndroidX.

This problem isn't specific to the RecyclerView either. There are other issue with Xamarin.Forms at the moment that they're still investigating.

 

Rest assured that the Telerik development team is investigating this and are working on a a solution. If you would like to track the Xamarin bug I files for this, you can do so here https://github.com/xamarin/AndroidX/issues/58 

Note: I will directly investigate the situation with XF 4.5, but know that because it is a pre-release version, we won't officially support it yet.

Regards,
Lance | Team Lead - US DevTools Support
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
Vitaly
Posted on: 20 Feb 2020 13:01

Hi Nadya, how can one uninstall  Xamarin.AndroidX.RecyclerView?

Thanks

Vitaly
Posted on: 20 Feb 2020 12:47
I have the same issue after upgrading to XF 4.5 and thus AndroidX.