java - 错误 :: java.lang.NoSuchMethodError: com.google.common.base.Preconditions.checkArgument(ZLjava/lang/String;Ljava/lang/Object;)V
问题描述
我收到此错误是因为我有 ValidationFramework.jar,其中包含与 Google Cloud Platform Libraries 相同的类,即 com.google.common.base.Preconditions.checkState() 并且 eclipse 正在为我的 java 应用程序选择 ValidationFramework 中的类。
谁能告诉我如何让eclipse为我的java服务选择谷歌云平台库?
解决方案
很可能您的依赖项之一使用旧番石榴。com.google.common.base.Preconditions
类在 Guava 库 ( com.google.guava:guava
) 中。您的类路径中有一个意外的 Guava 版本。如果您可以分享您的 pom.xml 或 build.gradle,我可以进一步检查。
推荐阅读
- python - 下载 SQL for Python 时出错
- php - 当标签被格式化并从 url 检索时,SQL 按标签搜索文章
- telerik-reporting - SUM(MAX(Fields.Amount)) 在 Telerik 报告中不起作用
- mysql - 删除和插入行mysql
- php - 根据选择选项值变化动态加载html表格
- sql - 如何在存储过程中从查询中设置输出参数值
- java - 带有父子指针的 JAXB
- css - 有没有办法根据它所在的容器来设置 Web 组件的样式?
- sql - 如何将 cmd 查询输出到 SQL Server 数据库?
- ios - Xamarin 表单:创建分发证书和 .p12 文件时出现问题