Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Issues updating Xamarin: unable to resolve dependencies

I recently decided to update everything in my Xamarin workspace, including all NuGet packages, and Xamarin.Forms.

I first installed all the newest Xamarin.Android.Support packages, which clashed with the current version of Xamarin.Forms that I had, so I decided that I needed to update Xamarin.Forms anyway. I removed it and installed all the other packages (which worked lovely) and now I am trying to reinstall Xamarin.Forms again, but I am receiving:

Unable to resolve dependencies. 'Xamarin.Android.Support.Design 23.4.0.1' is not compatible with 'Xamarin.Forms 2.3.0.107 constraint: Xamarin.Android.Support.Design (= 23.3.0)'.

Any suggestions?

like image 239
Aphire Avatar asked Jul 15 '16 14:07

Aphire


2 Answers

I'm quoting James Montemagno from the Xamarin Forums here.

Xamarin.Forms locks in a very specific version of the support libraries and google play services. You can't update them because Xamarin.Forms isn't compatible with them as it would need to be re-compiled.

Xamarin.Android.Support.v4 (= 23.0.1.3) Xamarin.Android.Support.Design (= 23.0.1.3) Xamarin.Android.Support.v7.AppCompat (= 23.0.1.3) Xamarin.Android.Support.v7.CardView (= 23.0.1.3) Xamarin.Android.Support.v7.MediaRouter (= 23.0.1.3)

See the = 23.0.1.3, which means it is only compatible with that version number. This is just how NuGet works. When Xamarin.Forms updates these packages will auto update.

Forms gets 'linked' to a specific version of the Android libraries so it can be guaranteed that it will work together as it should. At this point, Xamarin.Forms (stable) isn't updated yet to use the latest Android Support packages. So you probably want to go with a somewhat older version of Forms, or check if there is a Forms pre-release which already has a reference to the newer Android Support libraries.

Of course; using these is not recommended in a production environment.

They added it in the official FAQ

like image 198
Gerald Versluis Avatar answered Nov 01 '22 20:11

Gerald Versluis


According to me own experience, I would recommend to:

  1. If your project is very old, try to migrate the list of your packages from packages.config to the .CSPROJ. Unlike packages.config, PackageReference lists only those NuGet packages you directly installed in the project. As a result, the NuGet Package Manager UI and the project file aren't cluttered with down-level dependencies. More info here
  2. Clean the Nuget packages cache(s) : Tools -> NuGet Package Manager -> Package Manager Settings -> Clear All NuGet Cache(s)
  3. Use the NuGet Console to get more details about you errors. Open the console (Tools -> NuGet Package Manager -> Package Manager Console), then type Update-Package
  4. Always Clean and Rebuild after updating your packages
like image 29
ScifiX1972 Avatar answered Nov 01 '22 22:11

ScifiX1972