- 在VS中打开您遇到问题的解决方案。
- 转到工具> NuGet包管理器>包管理器设置 - >常规,然后点击“清除所有NuGet缓存”
- 这应该返回一个错误,因为你有一个项目打开,但如果没有,那么跳到步骤:6
- 不要关闭解决方案,但打开“运行”(Windows键+ R)并键入“cmd”并运行以下命令:清除本地文件夹 - Microsoft Docs
-
dotnet nuget locals http-cache --clear dotnet nuget locals global-packages --clear dotnet nuget locals temp --clear dotnet nuget locals plugins-cache --clear
- 命令2和4应该给你一个错误,这反过来会给你一个关于正在使用什么包的提示,可能是错误的原因。
- 现在关闭VS Solution并运行失败命令。现在所有命令都应该已成功运行。
- 再次打开解决方案。删除创建重复的NuGet并尝试再次构建解决方案。
- 现在你应该能够在没有错误的情况下构建你的项目: java.lang.IllegalArgumentException:已经添加:Landroid / support / annotation / AnimRes