Share via

Warning NU1608: Detected package version outside of dependency constraint: Xamarin.AndroidX.DataStore.Android 1.2.0.2 requires Xamarin.AndroidX.DataStore.Core.Android (>= 1.2.0.2 && < 1.2.1)

Kim Strasser 2,496 Reputation points
2026-04-28T08:08:12.5566667+00:00

I get these warnings after updating my NuGet packages:

warning NU1608: Detected package version outside of dependency constraint: Xamarin.AndroidX.DataStore.Android 1.2.0.2 requires Xamarin.AndroidX.DataStore.Core.Android (>= 1.2.0.2 && < 1.2.1) but version Xamarin.AndroidX.DataStore.Core.Android 1.2.1 was resolved. warning NU1608: Detected package version outside of dependency constraint: Xamarin.AndroidX.DataStore.Android 1.2.0.2 requires Xamarin.AndroidX.DataStore.Core.OkIO.Jvm (>= 1.2.0.2 && < 1.2.1) but version Xamarin.AndroidX.DataStore.Core.OkIO.Jvm 1.2.1 was resolved. warning NU1608: Detected package version outside of dependency constraint: Xamarin.AndroidX.DataStore.Preferences.Core.Android 1.2.0.2 requires Xamarin.AndroidX.DataStore.Core.Android (>= 1.2.0.2 && < 1.2.1) but version Xamarin.AndroidX.DataStore.Core.Android 1.2.1 was resolved. warning NU1608: Detected package version outside of dependency constraint: Xamarin.AndroidX.DataStore.Preferences.Core.Android 1.2.0.2 requires Xamarin.AndroidX.DataStore.Core.OkIO.Jvm (>= 1.2.0.2 && < 1.2.1) but version Xamarin.AndroidX.DataStore.Core.OkIO.Jvm 1.2.1 was resolved. warning NU1608: Detected package version outside of dependency constraint: Xamarin.AndroidX.DataStore.Preferences.Core.Android 1.2.0.2 requires Xamarin.AndroidX.DataStore.Preferences.Proto (>= 1.2.0.2 && < 1.2.1) but version Xamarin.AndroidX.DataStore.Preferences.Proto 1.2.1 was resolved.

Then I have tried to install Xamarin.AndroidX.DataStore.Core.Android 1.2.0.2 but I get this error:

Package restore failed. Rolling back package changes for 'MyProjectAndroid'. Warning As Error: Detected package downgrade: Xamarin.AndroidX.DataStore.Core.Android from 1.2.1 to 1.2.0.2. Reference the package directly from the project to select a different version. MyProjectAndroid -> Xamarin.AndroidX.DataStore.Preferences.Core.Jvm 1.2.1 -> Xamarin.AndroidX.DataStore.Core.Jvm 1.2.1 -> Xamarin.AndroidX.DataStore.Core.Android (>= 1.2.1) MyProjectAndroid -> Xamarin.AndroidX.DataStore.Core.Android (>= 1.2.0.2)

How can I solve the issue?

Screenshot 2026-04-28 100507 Screenshot 2026-04-28 100455

Developer technologies | .NET | .NET MAUI
0 comments No comments

Answer accepted by question author

  1. Jack Dang (WICLOUD CORPORATION) 17,420 Reputation points Microsoft External Staff Moderator
    2026-04-28T09:05:24.0066667+00:00

    Hi @Kim Strasser ,

    Thanks for reaching out.

    This is happening because the AndroidX DataStore packages are not all being resolved to the same version. Some of them are still on 1.2.0.2, while others have already moved to 1.2.1. NuGet then tries to satisfy both sets of dependency rules, and that is what leads to the NU1608 warning.

    Usually this warning does not mean the app is broken, but it is still worth cleaning up so restore/build remains consistent.

    The cleanest fix is to keep the whole Xamarin.AndroidX.DataStore.* package family on the same version. In this case, I would recommend moving them to 1.2.1, since one of the dependency chains already requires 1.2.1.

    Please check your project file or NuGet Package Manager and update any older DataStore packages, especially these if they are present:

    Xamarin.AndroidX.DataStore.Android

    Xamarin.AndroidX.DataStore.Core.Android

    Xamarin.AndroidX.DataStore.Core.Jvm

    Xamarin.AndroidX.DataStore.Core.OkIO.Jvm

    Xamarin.AndroidX.DataStore.Preferences.Core.Android

    Xamarin.AndroidX.DataStore.Preferences.Core.Jvm

    Xamarin.AndroidX.DataStore.Preferences.Proto

    They should all be using 1.2.1, or they should all be using the older 1.2.0.2 set. Mixing those two versions is what causes the warning.

    If you manage the references directly in the project file, you can align the affected packages like this:

    <ItemGroup Condition="$(TargetFramework.Contains('-android'))">
      <PackageReference Include="Xamarin.AndroidX.DataStore.Android" Version="1.2.1" />
      <PackageReference Include="Xamarin.AndroidX.DataStore.Core.Android" Version="1.2.1" />
      <PackageReference Include="Xamarin.AndroidX.DataStore.Core.OkIO.Jvm" Version="1.2.1" />
      <PackageReference Include="Xamarin.AndroidX.DataStore.Preferences.Core.Android" Version="1.2.1" />
      <PackageReference Include="Xamarin.AndroidX.DataStore.Preferences.Core.Jvm" Version="1.2.1" />
      <PackageReference Include="Xamarin.AndroidX.DataStore.Preferences.Proto" Version="1.2.1" />
    </ItemGroup>
    

    You may not need to add every package manually if some of them are only transitive dependencies. The important part is that there should not be any explicit 1.2.0.2 DataStore reference left while another DataStore package is resolving to 1.2.1.

    After updating the package versions, restore the NuGet packages again. If the warning still appears, delete the bin and obj folders, then restore/build once more so the old dependency graph is cleared.

    I would avoid suppressing NU1608 unless it is only needed as a short-term workaround. Aligning the package versions is the better fix here.

    Hope this helps! If my answer was helpful, I would greatly appreciate it if you could follow the instructions here so others with the same problem can benefit as well.

    1 person found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. Q&A Assist
    2026-04-28T08:08:35.1333333+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    NU1608 indicates that a resolved package version is outside the dependency constraint declared by another package. In this case, some Xamarin.AndroidX.DataStore packages require versions in the 1.2.0.2–<1.2.1 range, but NuGet resolved 1.2.1 because another package requires that higher version.

    This is expected behavior with PackageReference: a direct or closer dependency can override the version requested by another package. NuGet surfaces NU1608 as a warning so that the override is visible.

    To resolve this in a supported way:

    1. Decide which version of Xamarin.AndroidX.DataStore.* should be used across the project (for example, 1.2.1 if that’s what higher-level packages require).
    2. Add an explicit PackageReference in the project for that chosen version of each affected package (Core.Android, Core.OkIO.Jvm, Preferences.Proto, etc.). This makes the override intentional and consistent.
    3. If the higher version is known to be compatible, treat NU1608 as informational and either:
      • Suppress the warning for these packages, or
      • Lower the severity of NU1608 so it is not treated as an error.

    If instead the lower version is required, then the conflicting higher-level package (for example, Xamarin.AndroidX.DataStore.Preferences.Core.Jvm 1.2.1) must be downgraded to a version whose dependency constraints match 1.2.0.2. Otherwise NuGet will continue to report a downgrade or conflict.


    References:

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.