appium启动出现com.google.common.base.Throwables.throwI

大神链接:
https://blog.csdn.net/yunfeng482/article/details/76737683

报错日志:

Method arguments: "M6TGLMA721108530", "5190"
步骤1:启动------------>appium与应用
java.lang.NoSuchMethodError: com.google.common.base.Throwables.throwIfUnchecked(Ljava/lang/Throwable;)V
io.appium.java_client.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:253)
org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:548)
io.appium.java_client.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:42)
io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:1)
io.appium.java_client.android.AndroidDriver.execute(AndroidDriver.java:1)
org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:212)
org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:130)
io.appium.java_client.DefaultGenericMobileDriver.<init>(DefaultGenericMobileDriver.java:38)
io.appium.java_client.AppiumDriver.<init>(AppiumDriver.java:84)
io.appium.java_client.AppiumDriver.<init>(AppiumDriver.java:94)
io.appium.java_client.android.AndroidDriver.<init>(AndroidDriver.java:95)
base.DriverBase.initDriver(DriverBase.java:134)
autotest.runbase.BestRuner.BeforeClass(BestRuner.java:47)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:498)
org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:124)
org.testng.internal.MethodInvocationHelper.invokeMethodConsideringTimeout(MethodInvocationHelper.java:59)
org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:451)
org.testng.internal.Invoker.invokeConfigurations(Invoker.java:222)
org.testng.internal.Invoker.invokeConfigurations(Invoker.java:142)
org.testng.internal.TestMethodWorker.invokeBeforeClassMethods(TestMethodWorker.java:163)
org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:105)
org.testng.TestRunner.privateRun(TestRunner.java:648)
org.testng.TestRunner.run(TestRunner.java:505)
org.testng.SuiteRunner.runTest(SuiteRunner.java:455)
org.testng.SuiteRunner.runSequentially(SuiteRunner.java:450)
org.testng.SuiteRunner.privateRun(SuiteRunner.java:415)
org.testng.SuiteRunner.run(SuiteRunner.java:364)
org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:84)
org.testng.TestNG.runSuitesSequentially(TestNG.java:1187)
org.testng.TestNG.runSuitesLocally(TestNG.java:1116)
org.testng.TestNG.runSuites(TestNG.java:1028)
org.testng.TestNG.run(TestNG.java:996)
autotest.runbase.ExecMain.appiumIniterMain(ExecMain.java:29)
autotest.runbase.ExecMain.main(ExecMain.java:34)

修改配置文件:

应该是jar依赖的问题,可能发送冲突,或者引入版本不对。查看com.google.common.base.Throwables.throwIfUnchecked
经过错误位置检查发现此类和方法在guava-19.0.jar依赖中,后面经过源码查看,确实该com.google.common.base下的类Throwables无此方法,应该是appium的一个bug。
后面经过修改maven配置排除guava依赖,然后手动更新此jar包依赖到guava-22.0.jar后项目运行正常。

<dependency>
            <groupId>io.appium</groupId>
            <artifactId>java-client</artifactId>
            <!-- <version>5.0.0-BETA9</version> -->
            <version>4.1.2</version>
            <exclusions>
                <exclusion>
                    <groupId>org.springframework</groupId>
                    <artifactId>spring-core</artifactId>
                </exclusion>
                <!-- <exclusion>
                    <groupId>org.seleniumhq.selenium</groupId>
                    <artifactId>selenium-remote-driver</artifactId>
                </exclusion> -->
                <exclusion>
                    <groupId>com.google.guava</groupId>
                    <artifactId>guava</artifactId>
                </exclusion>
            </exclusions>

        </dependency>

        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
            <version>22.0</version>
        </dependency>

原文地址:https://blog.51cto.com/357712148/2433365

时间: 2024-10-04 21:32:26

appium启动出现com.google.common.base.Throwables.throwI的相关文章

浏览器启动不起来java.lang.NoClassDefFoundError: com/google/common/base/Function

java.lang.NoClassDefFoundError: com/google/common/base/Function 原因:只有以下两个包 解决方案:导入 selenium-server-standalone-2.44.0.jar 如果报json错就还需要导入json包json-20080701.jar

Caused by: java.lang.NoClassDefFoundError: com/google/common/base/MoreObjects

环境:jdk1.8 开发工具:IDEA 说明:今天在做springboot集成swagger2的时候,在启动程序的时候,报错 报错信息: Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled. 2019-02-24 19:32:26.026 ERROR 8660 --- [ restartedMain] o.s.boot.Sp

Selenium 运行时出现错误(java.lang.NoClassDefFoundError: com/google/common/base/Function)

已经写好了java脚本,点击运行的过程中如果出现如下的错误提示时: java.lang.NoClassDefFoundError: com/google/common/base/Function 问题出现的原因是: 没有将Selenium server的相关包导入到“Referenced Libraries”中: 可以使用如下的方法解决这个问题: 将鼠标放到已经创建好的Project上,右键点击 -->“Build Path”-->"Configure Build Path"

org.jvnet.hudson.reactor.ReactorException: com.google.common.util.concurrent.UncheckedExecutionException: com.thoughtworks.xstream.mapper.CannotResolveClassException: maven2-moduleset

org.jvnet.hudson.reactor.ReactorException: com.google.common.util.concurrent.UncheckedExecutionException: com.thoughtworks.xstream.mapper.CannotResolveClassException: maven2-moduleset at org.jvnet.hudson.reactor.Reactor.execute(Reactor.java:246) at h

java.lang.NoSuchMethodError: com.google.common.hash.HashFunction.hashInt(I)Lcom/google/common/hash/HashCode; 解决办法

今天在java 上运行spark查询的时候出现一个问题: java.lang.NoSuchMethodError: com.google.common.hash.HashFunction.hashInt(I)Lcom/google/common/hash/HashCode; 后google 了一下找到了一篇相类似的问题 http://mail-archives.us.apache.org/mod_mbox/spark-user/201412.mbox/%3CD0A4C915.6E0D%[emai

The method&#39;s class, com.google.common.collect.FluentIterable, is available from the following locations

报以下错误,是因为guava版本冲突. Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled. 2019-11-13 14:00:06.535 ERROR 18640 --- [restartedMain] o.s.b.d.LoggingFailureAnalysisReporter : *******************

appium 启动失败解决方案

本机下载了:AppiumForWindows,启动Appium.exe 的时候,立即提示:应用程序已停止运行!! 本机环境: WIN 7 64 位,后来查了资料才知道Appium 要求安装.net framework 4.5,本机4.0,于是升级立马搞定!! .net framework 4.5 下载地址:http://www.microsoft.com/zh-cn/download/details.aspx?id=30653 启动成功:

KVM服务启动报错:version Base not defined in file libdevmapper.so.1.02

新安装一台KVM服务器,启动KVM服务时候报错:version Base not defined in file libdevmapper.so.1.02 with link time reference 现象如下: # /etc/init.d/libvirtd startStarting libvirtd daemon: libvirtd: relocation error: libvirtd: symbol dm_task_get_info_with_deferred_remove, ver

Appium启动

1,启动Android 设备: //启动 //   set up appium //   File classpathRoot = new File(System.getProperty("user.dir")); //   File appDir = new File(classpathRoot, "apps"); //   File app = new File(appDir, "ContactManager.apk"); DesiredCa