dotnet / dotnet/android-libraries

Adding Xamarin.AndroidX.Work.Runtime to a project produces warning Detected package version outside of dependency constraint

Open
#1,375 0 comments 2 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
317
Forks
73
Avg merge
1d 8h
Merged PRs (30d)
17

Description

### Android framework version

net10.0-android

### Affected platform version

VS2026, net10

### Description

MAUI project already references Xamarin.AndroidX.Credentials 1.5.0.3 and Xamarin.AndroidX.Credentials.PlayServicesAuth 1.5.0.3. After adding Xamarin.AndroidX.Work.Runtime 2.11.1.1, the build started producing warnings

```
Detected package version outside of dependency constraint: Xamarin.AndroidX.Fragment.Ktx 1.8.8.1 requires Xamarin.AndroidX.Fragment (>= 1.8.8.1 && < 1.8.9) but version Xamarin.AndroidX.Fragment 1.8.9.2 was resolved.
Detected package version outside of dependency constraint: Xamarin.AndroidX.Activity.Ktx 1.10.1.3 requires Xamarin.AndroidX.Activity (>= 1.10.1.3 && < 1.10.2) but version Xamarin.AndroidX.Activity 1.12.4.1 was resolved.
Detected package version outside of dependency constraint: Xamarin.AndroidX.Lifecycle.ViewModel.Ktx 2.9.2.1 requires Xamarin.AndroidX.Lifecycle.ViewModel (>= 2.9.2.1 && < 2.9.3) but version Xamarin.AndroidX.Lifecycle.ViewModel 2.10.0.2 was resolved.
Detected package version outside of dependency constraint: Xamarin.AndroidX.SavedState.SavedState.Ktx 1.3.1.1 requires Xamarin.AndroidX.SavedState (>= 1.3.1.1 && < 1.3.2) but version Xamarin.AndroidX.SavedState 1.4.0.2 was resolved.
Detected package version outside of dependency constraint: Xamarin.AndroidX.Lifecycle.Runtime.Ktx.Android 2.9.2.1 requires Xamarin.AndroidX.Lifecycle.Runtime.Android (>= 2.9.2.1 && < 2.9.3) but version Xamarin.AndroidX.Lifecycle.Runtime.Android 2.10.0.2 was resolved.
Detected package version outside of dependency constraint: Xamarin.AndroidX.Lifecycle.Runtime.Ktx 2.9.2.1 requires Xamarin.AndroidX.Lifecycle.Runtime (>= 2.9.2.1 && < 2.9.3) but version Xamarin.AndroidX.Lifecycle.Runtime 2.10.0.2 was resolved.
```

Any way to fix this?

### Steps to Reproduce

1. MAUI project already references Xamarin.AndroidX.Credentials 1.5.0.3 and Xamarin.AndroidX.Credentials.PlayServicesAuth 1.5.0.3.
2. Add Xamarin.AndroidX.Work.Runtime 2.11.1.1

### Did you find any workaround?

_No response_

### Relevant log output

```shell

```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.