[英]NuGet package install fails “Package restore failed. Rolling back package changes for <xamarin.android>”
Installing any package fails with this error, updating packages also creates this error. 安装任何软件包都会失败,并显示此错误,更新软件包也会产生此错误。 Clearing the NuGet cache files causes this error to change to "access to the path mono.cecil.dll is denied" when trying to install "Xamarin.GooglePlayServices.Ads".
尝试安装“ Xamarin.GooglePlayServices.Ads”时,清除NuGet缓存文件会导致此错误更改为“拒绝访问mono.cecil.dll路径”。 Restarting visual studio causes the package restore error to come back.
重新启动Visual Studio会导致软件包还原错误再次出现。
Versions: 版本:
Visual Studio Information:
https://pastebin.com/vnuyZMWk Visual Studio Information:
https Visual Studio Information:
//pastebin.com/vnuyZMWk Xamarin.Forms Project: Xamarin.Forms项目:
Xamarin.Android project: Xamarin.Android项目:
Visual Studio: 视觉工作室:
Update visual studio
https://pastebin.com/GkEeRqg3 Update visual studio
https://pastebin.com/GkEeRqg3
Xamarin.Android project: Xamarin.Android项目:
Cleaning house 打扫房子
Fixing NuGet 修复NuGet
Update-Package -Reinstall
Update-Package -Reinstall
One way or another some of the NuGet packages used in Xamarin.Android used monoandroid81. Xamarin.Android中使用的NuGet软件包中的一种或另一种使用monoandroid81。 Even though my solution was set to use 80 some NuGet packages installed were only compatible with 81.
即使我的解决方案设置为使用80,但某些安装的NuGet软件包仅与81兼容。
This was shown in the NuGet Console. 这已在NuGet控制台中显示。
Package Xamarin.Android.Support.v7.MediaRouter 27.0.2 is not compatible with monoandroid80 (MonoAndroid,Version=v8.0). Package Xamarin.Android.Support.v7.MediaRouter 27.0.2 supports: monoandroid81 (MonoAndroid,Version=v8.1)
I faced the same error when I was trying to update the libraries one by one. 当我尝试一个接一个地更新库时,我遇到了同样的错误。 Then I tried selecting all required libraries and clicked the Update button bellow the search box and it works.
然后,我尝试选择所有必需的库,然后单击搜索框下方的“ 更新”按钮,它可以正常工作。 I have to tell that these libraries had dependencies between each other.
我必须告诉这些库之间相互依赖。
Here's an example: 这是一个例子:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.