Xamarin.AndroidX.Media3.ExoPlayer NuGet package has conflicting dependency requirements with Xamarin.AndroidX.Activity/Core
Description
Hi team,
I’m trying to install Xamarin.AndroidX.Media3.ExoPlayer (v1.6.1.1) into my project, but I get a package restore failure due to conflicting dependency constraints on Xamarin.AndroidX.Activity and Xamarin.AndroidX.Core.
Detected package version outside of dependency constraint: Xamarin.AndroidX.Activity.Ktx 1.9.3.2 requires Xamarin.AndroidX.Activity (>= 1.9.3.2 && < 1.9.4) but version Xamarin.AndroidX.Activity 1.10.0.0 was resolved. Detected package downgrade: Xamarin.AndroidX.Core from 1.16.0.1 to 1.15.0.2. Reference the package directly from the project to select a different version. Xamarin.AndroidX.Media3.ExoPlayer -> Xamarin.AndroidX.Media3.ExoPlayer 1.6.1.1 -> Xamarin.AndroidX.Core (>= 1.16.0.1)
My project and its dependencies require newer versions of AndroidX, but the ExoPlayer package is not compatible.
Questions:
-
Is there a roadmap or ETA for updating Xamarin.AndroidX.Media3.ExoPlayer to support the latest AndroidX dependencies (e.g., Xamarin.AndroidX.Activity 1.10.x, Xamarin.AndroidX.Core 1.16.x)?
-
Is there a recommended workaround or best practice to use Media3.ExoPlayer with up-to-date AndroidX packages?
-
Would it be possible to relax the version constraints or publish a version compatible with newer AndroidX?
Steps to reproduce:
- Create a Xamarin.Android (.NET 9) project with latest AndroidX NuGet packages.
- Install Xamarin.AndroidX.Media3.ExoPlayer via NuGet.
- Observe restore errors about conflicting dependency constraints.
We just mirror maven dependencies to NuGet, I see:
https://mvnrepository.com/artifact/androidx.media3/media3-exoplayer/1.6.1
So, is there a newer version of androidx.media3/media3-exoplayer you want to use here?
Try adding this:
<PackageReference Include="Xamarin.AndroidX.Activity.Ktx" Version="1.10.1.1" />
<PackageReference Include="Xamarin.AndroidX.Collection.Jvm" Version="1.5.0.1" />
<PackageReference Include="Xamarin.AndroidX.Collection.Ktx" Version="1.5.0.1" />
Reference this issue about the problem you are having: https://github.com/dotnet/android-libraries/issues/764
@byrneciaran
Can you provide all PackageReferences please? I will try to write a tool for this problem.
Try adding this:
<PackageReference Include="Xamarin.AndroidX.Activity.Ktx" Version="1.10.1.1" /> <PackageReference Include="Xamarin.AndroidX.Collection.Jvm" Version="1.5.0.1" /> <PackageReference Include="Xamarin.AndroidX.Collection.Ktx" Version="1.5.0.1" />Reference this issue about the problem you are having: #764
Close, but not completely accurate. The problem in the core is the same - transitive dependencies in complex (real world project).
Have you tried updating to Xamarin.AndroidX.Media3.x 1.7.1 there is now a new updated package available.