0

I'm seeing the following NuGet version conflict error after upgrading a Xamarin Forms library project to .Net7.0 MAUI;

"Version conflict detected for Xamarin.Android.Support.Annotations.

Install/reference Xamarin.Android.Support.Annotations 28.0.0.3 directly to project Library_Upgrade to resolve this issue.

Library_Upgrade -> Xamarin.Azure.NotificationHubs.Android 1.1.1 -> Xamarin.Android.Support.v7.AppCompat 28.0.0.3 -> Xamarin.Android.Support.Annotations (= 28.0.0.3)

Library_Upgrade -> Xamarin.Android.Support.Collections 28.0.0.1 -> Xamarin.Android.Support.Annotations (= 28.0.0.1)."

It seems two packages need different versions of Xamarin.Android.Support.Annotations (28.0.0.3 and 28.0.0.1).

If I do what the error suggests and install 28.0.03 directly, it doesn't install the package as the dependency on 28.0.0.1 stops the update.

  • 2
    Welcome to SO! In some cases, you have to manually uninstall the affected packages and install them in the correct order of the dependencies. I've experienced something like this myself already. You'll likely have to update `Xamarin.Android.Support.Collections` to version `28.0.0.3` as well, but for that you'll need to uninstall it first, because otherwise, it will not let you install version `28.0.0.3` of `Xamarin.Android.Support.Annotations`. – Julian Apr 25 '23 at 09:31
  • You can try to use the nuget package manager to uninstall the package and then reinstall the higher verion. Or you can open the csproj.file to add the higher verion directly. – Liyun Zhang - MSFT Jun 05 '23 at 07:43

1 Answers1

0

Have you tried removing:
Xamarin.Azure.NotificationHubs.Android and Xamarin.Android.Support.Collections from your project.

Then try to install:
Xamarin.Android.Support.Annotations version 28.0.0.3

Finally reinstall:
Xamarin.Azure.NotificationHubs.Android and Xamarin.Android.Support.Collections to your project

This should force the installation of the required version of Xamarin.Android.Support.Annotations (28.0.0.3) for both packages, and resolve the version conflict.