I can't start a new session in Appium

Hello.

I’m doing an automation with appium and java, however out of nowhere, when running from eclipse, it sends me a message that it cannot connect to Appium (Could not start a new session. The possible causes are the invalid address of the control remote Failed to start server or browser.
Host information: host:‘hostname’, ip:‘127.0.0.1’). I have tried other projects I had, but none of them can get the server up and log in.

However, when performing an emulation with Appium inspector it connects without problem and the server starts up.

Have you had anything similar and if so, how have you managed to solve it?

This is my code:

public void ConfigApp() throws MalformedURLException, URISyntaxException {

//para abir Appium al ejecutar el script
service = new AppiumServiceBuilder()
.withAppiumJS(new File(“\AppData\Roaming\npm\node_modules\appium\build\lib\main.js”))
.withIPAddress(“127.0.0.1”)
.usingPort(4723)
.build();

//Iniciar server appium
service.start();

UiAutomator2Options options = new UiAutomator2Options();

options.setDeviceName(“Pixel6Pro”);
options.setApp(“\Android\src\test\java\resources\app-10.apk”);

//establecer la conexión con server appium
driver = new AndroidDriver(new URI(“http://127.0.0.1:4723”).toURL(), options);

driver.manage().timeouts().implicitlyWait(Duration.ofSeconds(50));
}

Thank you very much in advance

What version of Appium Java client are you using?

Upgrade appium java-client. updating to 9.2.2 worked for me

2 Likes

Thank you. Yes, it was exactly the solution and it works without problem again. :100: