简体   繁体   中英

Xamarin.Forms install error message runaround

I created a new Xamarin.Forms project and I am trying to upgrade the Xamarin.Forms Nuget package from 3.6 to v4.3. When I try to install a newer version I get a runaround of error messages that goes in circles. Here's how it goes:

  • Right click on solution >Manage Nuget Packages
  • Installed Tab >Xamarin.Forms. Shows v3.6 installed in all projects (main/shared project, Android, UWP)
  • Select v4.3 and install upgrade to all projects
  • Error: Error NU1107 Version conflict detected for Xamarin.Android.Support.Compat. Install/reference Xamarin.Android.Support.Compat 28.0.0.3 directly to project HPlusSports.Android to resolve this issue.
  • I search for Xamarin.Android.Support.Compat, select v28.0.0.3 and install it directly into my Android project.
  • Error: Error NU1107 Version conflict detected for Xamarin.Android.Support.Annotations. Install/reference Xamarin.Android.Support.Annotations 28.0.0.3 directly to project HPlusSports.Android to resolve this issue.
  • I search for Xamarin.Android.Support.Annotations, select v28.0.0.3 and install it directly into my Android project.
  • Error: Error NU1107 Version conflict detected for Xamarin.Android.Support.Annotations. Install/reference Xamarin.Android.Support.Annotations 28.0.0.3 directly to project HPlusSports.Android to resolve this issue.

So I follow the instructions in the error messages but the error messages just go in circles. No matter what I try to install there is no resolve.

If only updating Xamarin Forms Nuget Package will occur other Nuget Package conflict with it.

Have a try with follow steps:

  • Right click project solution
  • Click Manage Nuget Package for Solution
  • Go to Updates view
  • Select All Packages
  • Last click Update button

Such as follow screenshot:

在此处输入图像描述

To this problem, open your android project.csproj file by notepad.

Add the package into PackageReference directly. Save it and open the solution again.

Example:

<PackageReference Include="Xamarin.Forms" Version="4.4.0.991864" />
<PackageReference Include="Xamarin.Android.Support.VersionedParcelable">
  <Version>28.0.0.3</Version>
</PackageReference>
<PackageReference Include="Xamarin.Android.Support.Interpolator">
  <Version>28.0.0.3</Version>
</PackageReference>
<PackageReference Include="Xamarin.Android.Support.v7.RecyclerView">
  <Version>28.0.0.3</Version>
</PackageReference>
<PackageReference Include="Xamarin.Android.Support.Fragment">
  <Version>28.0.0.3</Version>
</PackageReference>
<PackageReference Include="Xamarin.Android.Support.Core.UI">
  <Version>28.0.0.3</Version>
</PackageReference>
<PackageReference Include="Xamarin.Android.Support.Core.Utils">
  <Version>28.0.0.3</Version>
</PackageReference>
<PackageReference Include="Xamarin.Android.Support.Annotations">
  <Version>28.0.0.3</Version>
</PackageReference>
<PackageReference Include="Xamarin.Android.Support.CursorAdapter">
  <Version>28.0.0.3</Version>
</PackageReference>
<PackageReference Include="Xamarin.Android.Support.Collections">
  <Version>28.0.0.3</Version>
</PackageReference>
<PackageReference Include="Xamarin.Android.Support.Compat">
  <Version>28.0.0.3</Version>
</PackageReference>
<PackageReference Include="Xamarin.Android.Support.Design">
  <Version>28.0.0.3</Version>
</PackageReference>

Try this procedure. Solution

  1. Update-package
  2. Update-Package -reinstall
  3. Restart visual studio.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM