How to fix Xamarin/NuGet error NU1107? - "Version conflict detected for Xamarin.Android.Support.Compat"

"NU1107 Version conflict detected for Xamarin.Android.Support.Compat. Reference the package directly from the project to resolve this issue. pleaseWork.Android -> Xamarin.Android.Support.v7.MediaRouter 27.0.2 -> Xamarin.Android.Support.v7.Palette 27.0.2 -> Xamarin.Android.Support.Compat (= 27.0.2) pleaseWork.Android -> pleaseWork -> Plugin.Share 7.1.1 -> Xamarin.Android.Support.CustomTabs 25.4.0.2 -> Xamarin.Android.Support.Compat (= 25.4.0.2)."

I keep getting this error when I try to install plugins to my Xamarin projects. I have no idea how to fix this error and I've scoured all over the internet to find solutions.

I've tried to install the same plugin on multiple Xamarin projects all to no avail

1 answer

  • answered 2018-07-11 06:49 Leo Liu-MSFT

    How to fix Xamarin/NuGet error NU1107? - “Version conflict detected for Xamarin.Android.Support.Compat”

    Got the same error message as you, if I install the package Plugin.Share 7.1.1 to my Xamarin with reference Xamarin.Android.Support.v7.MediaRouter 27.0.2.

    To resolve this issue, please install the dependency Xamarin.Android.Support.CustomTabs with version 27.0.2 first, then install the package Plugin.Share 7.1.1.

    The reason for this solution:

    Just like the error message shows, the default package of Xamarin project is Xamarin.Android.Support.v7.MediaRouter 27.0.2, which have a indirect dependency Xamarin.Android.Support.Compat (= 27.0.2). However, the package Plugin.Share 7.1.1 also have a indirect dependency Xamarin.Android.Support.Compat (= 25.4.0.2), which lower than the already installed version 27.0.2. So nuget will give you the error NU1107 Version conflict detected for Xamarin.Android.Support.Compat.

    In order to use the same version package Xamarin.Android.Support.Compat, we have to update the referencing package Xamarin.Android.Support.CustomTabs to 27.0.2, which is supported by the referencing package Plugin.Share 7.1.1.

    So, the solution for this issue is install the Xamarin.Android.Support.CustomTabs 27.0.2 first, then install the package Plugin.Share 7.1.1.

    Hope this helps.