NoSuchMethodError exception when using com.google.common.base.Splitter

前端 未结 7 2107
一个人的身影
一个人的身影 2021-01-17 07:38

I\'m trying to use com.google.common.base.Splitter as follows

Iterable segs = Splitter.on(\"/\").split(\"one/two/three/four/five\");

for (Stri         


        
7条回答
  •  醉酒成梦
    2021-01-17 08:26

    For me this happens when you have a dependency which depends on an earlier version of Guava, and this dependency is listed first. Guava will be resolved at the place it was found first and ignore the rest.

    The fix is to add the dependency on guava first, but careful that it does not break other projects which use guava

提交回复
热议问题