13
votes

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?

6

6 Answers

14
votes

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

3
votes

You can't update Xamarin.Forms and Xamarin.Android at the same time. As It has dependency issues with versions. So first, Select only Xamarin.Forms 2.3.0.107 and update. After that, Select rest of the Xamarin.Android.support lists and update.

1
votes

I would extremelly recommend by 1 year of experience with Xamarin.Droid and Xamarin.iOS to only update Xamarin.Forms to latest version, and ignore Other Xam.Support Libraries unless is extremelly necessary to bug fix something that you need.

Reason #1: It is not fully tested by Microsoft.

Reason #2: You might need to spend hours configuring and fixing the references e version compatibility.

1
votes

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
0
votes

For Resolution follow below steps

  1. Close Visual Studio and Navigate following Folder C:\Users\\AppData\Local\Xamarin and Remove “ Zib “ Folder (it will re-create automatically while build solution )
  2. Right Click on Your Solution /Project ➔ manage nuget Package➔ Click on Update tab ➔ Update Xamarin Form
  3. Restart Visual studio⇒Open project ==> Clean Solution and build Add your Nuget package Now

Refered from : https://xamarininterviewquestion.blogspot.in/2016/12/upgrade-nuget-xamarinandroidsupportdesi.html

0
votes

Starting with Xamarin.Forms 2.3.4 you can manually update all the Xamarin.Android.Support NuGet packages. The condition is that the Target Framework and the Target Android version options of your project (if you don't know what I'm talking about check out this page: Understanding Android API Levels) are set to at least Android 7.0, i.e API 24, or higher.

The official Xamarin documentation has also been updated: Xamarin Forms Troubleshooting