Problem background Description
With the official Appiumdriverlocalservice method, the code starts Appium server
1 ImportIo.appium.java_client.service.local.AppiumDriverLocalService;2 ImportIo.appium.java_client.service.local.AppiumServiceBuilder;3 ImportIo.appium.java_client.service.local.flags.GeneralServerFlag;4 5 6 /**7 * @authorKingdow8 * @date 2018/5/18 17:319 */Ten Public classAppiumdrivertest { One A Public Static voidMain (string[] args) { - -Appiumservicebuilder Builder =NewAppiumservicebuilder () the . Withargument (generalserverflag.session_override) -. Withipaddress ("127.0.0.1") - . Usinganyfreeport (); -Appiumdriverlocalservice Service =Appiumdriverlocalservice.buildservice (builder); + Service.start (); - } +}
Get the following error message
ExceptioninchThread"Main"Io.appium.java_client.service.local.AppiumServerHasNotBeenStartedLocallyException:The local appium server have not been started. The given node. js Executable:c:\program files\nodejs\node.exe Arguments: [C:\Users\KingDow\AppData\Roaming\npm\node_ Modules\appium\build\lib\main.js,--port,8000,--address,127.0.0.1,--session-Override] at Io.appium.java_client.service.local.AppiumDriverLocalService.start ( Appiumdriverlocalservice.java:149) at Com.ziroom.vayne.appium.server.AppiumDriverTest.main (Appiumdrivertest.java: -) at Sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method) at Sun.reflect.NativeMethodAccessorImpl.invoke (Nativemethodaccessorimpl.java: +) at Sun.reflect.DelegatingMethodAccessorImpl.invoke (Delegatingmethodaccessorimpl.java: +) at Java.lang.reflect.Method.invoke (Method.java:498) at Com.intellij.rt.execution.application.AppMain.main (Appmain.java:144) caused By:java.lang.NoSuchMethodError:com.google.common.util.concurrent.SimpleTimeLimiter.create (Ljava /util/concurrent/executorservice;) lcom/google/common/util/concurrent/Simpletimelimiter; At Org.openqa.selenium.net.UrlChecker.<init> (Urlchecker.java: +) at Io.appium.java_client.service.local.AppiumDriverLocalService.Ping(Appiumdriverlocalservice.java:113) at Io.appium.java_client.service.local.AppiumDriverLocalService.start (Appiumdriverlocalservice.java:136) ... 6 MoreProcess finished with exit code1
Problem analysis Positioning
The referenced third-party dependency package version conflict, which was found to be positioned as Com.google.guava version too low, does not have the Simpletimelimiter create () method in the original version 20.0.
Problem Solving Methods
After updating the latest version of guava, see the source code Create () method exists
<!--Https://mvnrepository.com/artifact/com.google.guava/guava -<Dependency> <groupId>Com.google.guava</groupId> <Artifactid>Guava</Artifactid> <version>25.1-jre</version></Dependency>
Unable to start Appium service issue through Appiumdriverlocalserivce