-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Getting (The type 'Worker' exists in both...) with pre release #9546
Comments
@jrahma can you include some additional information ?
|
@PureWeen I don't have a Repo because it's a business project Here is my BuildOutput and these are my References |
@jrahma if you roll these down to rc1
|
@jrahma I believe this is because the But, there may be a few things we can do... The first is to see if you can just remove the But, if there is some dependency that actually requires the If it is an external package that you have no control over, then there is one thing that you may be able to get away with. Just update the reference to: <PackageReference Include="Xamarin.Android.Arch.Work.Runtime">
<Version>1.0.0.3</Version>
<ExcludeAssets>all</ExcludeAssets>
</PackageReference> What this is doing is basically saying that NuGet should install the package to satisfy dependencies, but not actually do anything with it. This means that NOTHING from the nuget will even get loaded - and this is what we want. MSBuild must not see that package at all. When you build, the compiler will use the AndroidX version, and then update all references from support to AndroidX. Then, at runtime, all will be working. Let me know if this helps or works. |
@mattleibow Removing the Xamarin.Android.Arch.Work.Runtime still causing errors. Here is my Build Output Regarding updating Xamarin.Android.Arch.Work.Runtime to 1.0.0.3, it was already on this version when I am getting the above errors. |
Did not solve the problem |
@jrahma The package
from your
Since the 2.0 and above version of For example, here is the old package: Notice there are Here is the new package: This has all the |
@JonDouglas even after removing the X I still get errors and this is the Project file: and BuildOutput: |
@jrahma Can you provide the build output? I see two project files. Additionally we will need to know where |
If you can set that to diagnostic and give the build output that would be helpful Or from a command line if you could do
that will generate an msbuild.binlog file you can attach |
Sorry, Updated it above This is where the error comes: and this is the AthanTime.cs:
|
@PureWeen above BuildOutput is already set to diagnostic |
This might be caused by https://www.nuget.org/packages/Plugin.LocalNotification/ which brings in the |
@jrahma alright try this :-) I was able to reproduce your issue and then get it compile
<PackageReference Include="Plugin.LocalNotification" ExcludeAssets="compile">
<Version>4.1.3</Version>
</PackageReference> Once/if you get that working then I would recommend pruning down your csproj file a bit. Just remove all the support/androidx/playservices that you can to get it down to compiling It's ideal when anything transitive is just brought in transitively |
Yes, Updating the PluginLocalNotification fixes the Worker's errors Thank you |
@jrahma great to hear!! Thank you for getting back to us on this so quickly |
@jrahma so looking a bit deeper into this it looks like my suggestion to you was incorrect and now it's just not including the LocalNotifications package at all I've logged an issue with Plugin.LocalNotifications to look at updating to androidx and we're also looking to see if we can workaround this issue ourselves xamarin/AndroidX#55 For now I would recommend targeting Android 9.0 instead of 10.0 and once any of the above resolutions are finished then you can switch back to 10.0 |
Hi,
I have updated my Xamarin Forms to latest pre 4.5 and now I am getting:
Error CS0433 The type 'Worker' 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'
Thanks,
Jassim
The text was updated successfully, but these errors were encountered: