【发布时间】:2021-01-09 18:17:45
【问题描述】:
如果我将 com.google.truth.extensions:truth-proto-extension:1.1 jar 添加到我的 bazel 工作区,它似乎完全从 com.google.guava:guava:28.2-jre 中删除类,导致类似的错误
import static com.google.common.collect.ImmutableMap.toImmutableMap;
^
symbol: static toImmutableMap
location: class ImmutableMap
java/com/google/fhir/protogen/ProtoGenerator.java:316: error: cannot find symbol
.collect(toImmutableMap(def -> def.getId().getValue(), def -> def));
^
symbol: method toImmutableMap((def)->def[...]lue(),(def)->def)
location: class ProtoGenerator
你的文档说
One warning: Truth depends on the “Android” version of Guava, a subset of the “JRE” version.
If your project uses the JRE version, be aware that your build system might select the Android version instead.
If so, you may see “missing symbol” errors.
The easiest fix is usually to add a direct dependency on the newest JRE version of Guava.
这是否意味着除了 com.google.guava:guava:28.2-jre 上的 maven dep 之外的其他任何东西?如果没有,下一个最简单的解决方法是什么?
【问题讨论】:
标签: google-truth