简体   繁体   English

Xamarin.Forms 安装错误消息 runaround

[英]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. 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右键单击解决方案>管理 Nuget 包
  • Installed Tab >Xamarin.Forms.已安装选项卡 >Xamarin.Forms。 Shows v3.6 installed in all projects (main/shared project, Android, UWP)显示所有项目中安装的 v3.6(主/共享项目、Android、UWP)
  • Select v4.3 and install upgrade to all projects Select v4.3 并安装升级到所有项目
  • Error: Error NU1107 Version conflict detected for Xamarin.Android.Support.Compat.错误:为 Xamarin.Android.Support.Compat 检测到错误 NU1107 版本冲突。 Install/reference Xamarin.Android.Support.Compat 28.0.0.3 directly to project HPlusSports.Android to resolve this issue.将 Xamarin.Android.Support.Compat 28.0.0.3 直接安装/引用到项目 HPlusSports.Android 以解决此问题。
  • I search for Xamarin.Android.Support.Compat, select v28.0.0.3 and install it directly into my Android project. 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.错误:为 Xamarin.Android.Support.Annotations 检测到错误 NU1107 版本冲突。 Install/reference Xamarin.Android.Support.Annotations 28.0.0.3 directly to project HPlusSports.Android to resolve this issue.将 Xamarin.Android.Support.Annotations 28.0.0.3 直接安装/引用到项目 HPlusSports.Android 以解决此问题。
  • I search for Xamarin.Android.Support.Annotations, select v28.0.0.3 and install it directly into my Android project. 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.错误:为 Xamarin.Android.Support.Annotations 检测到错误 NU1107 版本冲突。 Install/reference Xamarin.Android.Support.Annotations 28.0.0.3 directly to project HPlusSports.Android to resolve this issue.将 Xamarin.Android.Support.Annotations 28.0.0.3 直接安装/引用到项目 HPlusSports.Android 以解决此问题。

So I follow the instructions in the error messages but the error messages just go in circles.所以我按照错误消息中的说明进行操作,但错误消息只是 go 圆圈。 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. 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单击管理 Nuget Package 获取解决方案
  • Go to Updates view Go 到更新视图
  • Select All Packages Select 所有封装
  • Last click Update button最后点击更新按钮

Such as follow screenshot:如以下截图:

在此处输入图像描述

To this problem, open your android project.csproj file by notepad.对于这个问题,用记事本打开你的 android project.csproj 文件。

Add the package into PackageReference directly.将 package 直接添加到 PackageReference 中。 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.重新启动视觉工作室。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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