zoukankan      html  css  js  c++  java
  • java.lang.NoSuchMethodError: com.google.common.base.Preconditions.checkState(ZLjava/lang/String;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)V

    原因一:

    没有设置chrome driver的位置

    //设置driver位置的方法。

    System.setProperty(“webdriver.chrome.driver”, “/Users/supinrong/code/driver/chromedriver”);

    原因二:

    guava版本冲突

    The problem is that both dependencies depend on a different com.google.guava:guava artifact.

    In order to solve the error, you should explicitly depend on a single com.google.guava:guava artifact. So go ahead and add the following in your build.gradle:

    compile 'com.google.guava:guava:27.0.1-jre'

    将以下依赖项复制并粘贴到pom.xml中,然后进行Maven构建:

    <!--   https://stackoverflow.com/questions/49021707/java-lang-nosuchmethoderror-com-google-common-base-preconditions-checkstatezlj?rq=1  -->
    <!-- https://mvnrepository.com/artifact/com.google.guava/guava -->
    <dependency>
        <groupId>com.google.guava</groupId>
        <artifactId>guava</artifactId>
        <version>27.1-jre</version>
    </dependency>
  • 相关阅读:
    支付宝沙箱环境应用
    七牛云视频托管
    腾讯云短息验证码接口
    git远程连接(码云)
    git
    字间距
    html文本保留空格
    mysql重启导致AUTO_INCREMENT从1开始
    js保留两位小数
    vue中watch的基本用法
  • 原文地址:https://www.cnblogs.com/changbj/p/13192664.html
Copyright © 2011-2022 走看看