xamarin / GooglePlayServicesComponents

Other
314 stars 146 forks source link

Package incompatibility: "Ads.Lite" & "AndroidX.Preference" #907

Closed tipa closed 2 months ago

tipa commented 2 months ago

Xamarin.Android Version (eg: 6.0):

.NET 8

Google Play Services Version

123.1.0

Describe your Issue

I am using Xamarin.AndroidX.Preference v1.2.1.8 & Xamarin.GooglePlayServices.Ads.Lite v123.1.0. It's not possible to update Xamarin.AndroidX.Preference to the latest version 1.2.1.9:

Version conflict detected for Xamarin.AndroidX.Lifecycle.LiveData.Core.Ktx. Install/reference Xamarin.AndroidX.Lifecycle.LiveData.Core.Ktx 2.8.4.1 directly to project test to resolve this issue. 
 test -> Xamarin.AndroidX.Preference 1.2.1.9 -> Xamarin.AndroidX.Fragment.Ktx 1.8.2.1 -> Xamarin.AndroidX.Lifecycle.LiveData.Core.Ktx (>= 2.8.4.1) 
 test -> Xamarin.GooglePlayServices.Ads.Lite 123.1.0 -> Xamarin.AndroidX.Work.Runtime 2.9.0.5 -> Xamarin.AndroidX.Lifecycle.LiveData 2.8.3.1 -> Xamarin.AndroidX.Lifecycle.LiveData.Core.Ktx (>= 2.8.3.1 && < 2.8.4).   test    C:\Users\timop\Desktop\test\test.csproj 1       

Packages used:

    <PackageReference Include="Xamarin.AndroidX.Preference" Version="1.2.1.8" />
    <PackageReference Include="Xamarin.GooglePlayServices.Ads.Lite" Version="123.1.0" />

Workaround:

I also need to explicitly add all these packages to the csproj to resolve the problem:

    <PackageReference Include="Xamarin.AndroidX.Lifecycle.Common" Version="2.8.4.1" />
    <PackageReference Include="Xamarin.AndroidX.Lifecycle.LiveData.Core" Version="2.8.4.1" />
    <PackageReference Include="Xamarin.AndroidX.Lifecycle.LiveData.Core.Ktx" Version="2.8.4.1" />

This workaround however then leads to the following warnings:

....csproj : warning NU1608: Detected package version outside of dependency constraint: Xamarin.AndroidX.Lifecycle.LiveData 2.8.3.1 requires Xamarin.AndroidX.Lifecycle.LiveData.Core.Ktx (>= 2.8.3.1 && < 2.8.4) but version Xamarin.AndroidX.Lifecycle.LiveData.Core.Ktx 2.8.4.1 was resolved.
....csproj : warning NU1608: Detected package version outside of dependency constraint: Xamarin.AndroidX.Lifecycle.LiveData 2.8.3.1 requires Xamarin.AndroidX.Lifecycle.LiveData.Core (>= 2.8.3.1 && < 2.8.4) but version Xamarin.AndroidX.Lifecycle.LiveData.Core 2.8.4.1 was resolved.
....csproj : warning NU1608: Detected package version outside of dependency constraint: Xamarin.AndroidX.Lifecycle.Service 2.8.3.1 requires Xamarin.AndroidX.Lifecycle.Runtime (>= 2.8.3.1 && < 2.8.4) but version Xamarin.AndroidX.Lifecycle.Runtime 2.8.4.1 was resolved.
tipa commented 2 months ago

Seems to be fixed with the latest round of updates