如何解决无法添加 NuGet 包
当我尝试将 Plugin.FirebasePushNotification
添加到 Xamarin.Forms 中的 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.
解决方法
尝试通过命令行清除 NuGet 缓存:
nuget locals all -clear
要设置 nuget
,您可以查看 NuGet CLI reference 的 macOS/Linux 部分。
通过手动编辑 .csproj 文件以包含错误中指示的包解决了问题。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。