appium/java-client

Error Attempting To Start Appium Programmatically with Version 9.0.0, Repeat of Issue 1907

Warren25 opened this issue · 5 comments

Description

Getting Receiver class java.lang.AbstractMethodError: Receiver class io.appium.java_client.service.local.AppiumServiceBuilder does not define or inherit an implementation of the resolved method 'abstract void loadSystemProperties()' of abstract class org.openqa.selenium.remote.service.DriverService$Builder.
error while initiating AppiumDriverLocalService.

I believe this issue to be directly related to #1907 (comment)

Environment

  • Appium Java Client Version: 9.0.0
  • Appium server version: 2.4.1
  • Desktop OS/version used to run Appium if necessary: MacOS Monterey 12.5
  • Node.js version: v20.10.0
  • Mobile platform/version under test: Android
  • Real device or emulator/simulator: Emulator

Details

_I am using appium java client 9.0.0 since it is the latest and also 8.5.0 seems to not be recognized as a valid dependency in Maven.

Code fails at line where AppiumDriverLocalService is invoked._

Code To Reproduce Issue [ Good To Have ]

public static void startAppiumServer() {
        AppiumServiceBuilder builder = new AppiumServiceBuilder();
        builder.withIPAddress("127.0.0.1")
                .usingPort(4723)
                .withArgument(BASEPATH, "wd/hub")
                .withArgument(SESSION_OVERRIDE)
                .withArgument(LOG_LEVEL, "info");

        service = AppiumDriverLocalService.buildService(builder);

        try {
            service.start();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

Exception Stacktraces

Step failed
java.lang.AbstractMethodError: Receiver class io.appium.java_client.service.local.AppiumServiceBuilder does not define or inherit an implementation of the resolved method 'abstract void loadSystemProperties()' of abstract class org.openqa.selenium.remote.service.DriverService$Builder.
	at org.openqa.selenium.remote.service.DriverService$Builder.build(DriverService.java:495)
	at io.appium.java_client.service.local.AppiumDriverLocalService.buildService(AppiumDriverLocalService.java:90)
	at utils.AppiumServerController.startAppiumServer(AppiumServerController.java:21)
	at tests.SampleTest.test(SampleTest.java:24)

@Warren25 how do you specify the version of Appium client?

@valfirst

Here is where I list the Appium Java client in my pom file

image

Please make sure to use compatible version of Appium Java client and Selenium client: https://github.com/appium/java-client?tab=readme-ov-file#compatibility-matrix

Serenity also uses own range of Appium and Selenium versions: https://github.com/serenity-bdd/serenity-core/blob/fc35b519bc57595eb9a29e65994aad55317596e8/pom.xml#L65-L76, make sure your classpath doesn't contain any incompatible JAR-s

Duplicate of #1907