首页 > 解决方案 > 无法添加 NuGet 包

问题描述

当我尝试在 Xamarin.Forms 中将其添加Plugin.FirebasePushNotification到我的 Xamarin.Android 项目时,我收到以下消息,并且未添加包。但是,它似乎在 iOS 和共享项目上运行良好。我将如何解决这个问题?

All packages and projects are compatible with MonoAndroid,Version=v11.0.
Package restore failed. Rolling back package changes

包还原期间的消息:

Version conflict detected for Xamarin.Android.Support.Collections. Install/reference Xamarin.Android.Support.Collections 28.0.0.3 directly to project Project.Android to resolve this issue. 
 Project.Android -> Project -> Plugin.FirebasePushNotification 3.3.10 -> Xamarin.Android.Support.v4 28.0.0.3 -> Xamarin.Android.Support.Media.Compat 28.0.0.3 -> Xamarin.Android.Support.VersionedParcelable 28.0.0.3 -> Xamarin.Android.Support.Collections (= 28.0.0.3) 
 Project.Android -> Project -> Xamarin.Auth 1.7.0 -> Xamarin.Android.Support.CustomTabs 28.0.0.1 -> Xamarin.Android.Support.Collections (= 28.0.0.1).
Restore failed.

标签: xamarinxamarin.androidnugetnuget-packagenuget-package-restore

解决方案


尝试通过命令行清除 NuGet 缓存:

nuget locals all -clear

要进行设置nuget,您可以查看NuGet CLI 参考的macOS/Linux部分。


推荐阅读