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

前端 未结 7 2039
一个人的身影
一个人的身影 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:22

    Use the below dependency to fix the issue

    To add a dependency on Guava using Maven, use the following:

    
      com.google.guava
      guava
      19.0
    
    

    To add a dependency using Gradle:

    dependencies {
      compile 'com.google.guava:guava:19.0'
    }
    

提交回复
热议问题