xamarin / AndroidSupportComponents

Xamarin bindings for Android Support libraries - For AndroidX see https://github.com/xamarin/AndroidX
MIT License
146 stars 56 forks source link

WorkerParameters not working after upgrading to 4.3.0.819712-pre2 #214

Open jrahma opened 5 years ago

jrahma commented 5 years ago

Hi,

Why I am started getting this error:

The type 'WorkerParameters' exists in both 'Xamarin.Android.Arch.Work.Runtime, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' and 'Xamarin.AndroidX.Work.Runtime, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'

Everything was working before and I don't have the Xamarin.AndroidX.Work.Runtime in my installed Nuget packages.

This happend after installing the latest Xamarin Forms preview 4.3.0.819712-pre2

How can I resolve this please?

Thanks, Jassim

jrahma commented 5 years ago

After adding Xamarin.AndroidX I am now getting:

Program type already present: androidx.versionedparcelable.CustomVersionedParcelable

Redth commented 5 years ago

I believe this is due to the fact that Google decided to name the api's for work manager using the androidx package name in the Android Support library, so having both the old Xamarin.Android.Arch.Work.Runtime and Xamarin.AndroidX.Work.Runtime packages installed is unnecessary and in this case problematic.

Can you try removing Xamarin.Android.Arch.Work.Runtime from your project and rebuilding?

Since the .NET managed API should be the same in both packages, this should still allow you to 'migrate' without changing your managed .net code.

jrahma commented 5 years ago

I already tried that but did not work

I had to downgrade by opting out the preview version

Redth commented 5 years ago

@jrahma do you have a repro sample you could share?

jrahma commented 5 years ago

nope, but I will try to make it and update you

Redth commented 5 years ago

@mattleibow i suspect we're going to need to update the mapping files for the migration package to account more appropriately for this scenario...