大神链接:
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.(RemoteWebDriver.java:130)
io.appium.java_client.DefaultGenericMobileDriver.(DefaultGenericMobileDriver.java:38)
io.appium.java_client.AppiumDriver.(AppiumDriver.java:84)
io.appium.java_client.AppiumDriver.(AppiumDriver.java:94)
io.appium.java_client.android.AndroidDriver.(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后项目运行正常。


            io.appium
            java-client
            
            4.1.2
            
                
                    org.springframework
                    spring-core
                
                
                
                    com.google.guava
                    guava
                
            

        

        
            com.google.guava
            guava
            22.0