appium/java-client

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.

kuldeep04 opened this issue ยท 21 comments

Description

Getting Receiver class io.appium.java_client.service.local.AppiumServiceBuilder error while initiating AppiumDriverLocalService.

Environment

  • Java client build version - v8.4.0
  • Appium server version - v2.0.0-beta.66
  • Desktop OS/version used to run Appium if necessary: Apple M1 Pro 13.3.1 (a)
  • Node.js version : Node.js v20.1.0
  • Mobile platform/version under test: Android
  • Real device or emulator/simulator: Real device

Details

Please provide more details, if necessary.

Code To Reproduce Issue [ Good To Have ]

public void startAppiumServer(int portNumber){ AppiumDriverLocalService localService; AppiumServiceBuilder builder = new AppiumServiceBuilder().usingPort(portNumber) .withArgument(GeneralServerFlag.BASEPATH, "/wd/hub/") .withArgument(GeneralServerFlag.RELAXED_SECURITY) .withArgument(GeneralServerFlag.USE_DRIVERS, "uiautomator2") .withLogFile(new File("./appium.log")); localService = AppiumDriverLocalService.buildService(builder); localService.start(); url= localService.getUrl(); localService.getUrl().toString().replace("/wd/hub/", ""); System.out.println("Appium server has been started successfully with port number "+ portNumber);

Exception Stacktraces

`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:496)
at io.appium.java_client.service.local.AppiumDriverLocalService.buildService(AppiumDriverLocalService.java:90)
at org.phonepe.driver.AppsCapabilities.startAppiumServer(AppsCapabilities.java:67)
at org.phonepe.driver.AppsCapabilities.capabilities(AppsCapabilities.java:31)
at org.phonepe.test.PhonePeTest.setConfig(PhonePeTest.java:41)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at org.testng.internal.invokers.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:139)
at org.testng.internal.invokers.MethodInvocationHelper.invokeMethodConsideringTimeout(MethodInvocationHelper.java:69)
at org.testng.internal.invokers.ConfigInvoker.invokeConfigurationMethod(ConfigInvoker.java:361)
at org.testng.internal.invokers.ConfigInvoker.invokeConfigurations(ConfigInvoker.java:296)
at org.testng.TestRunner.invokeTestConfigurations(TestRunner.java:644)
at org.testng.TestRunner.beforeRun(TestRunner.java:633)
at org.testng.TestRunner.run(TestRunner.java:595)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:437)
at org.testng.SuiteRunner$SuiteWorker.run(SuiteRunner.java:475)
at org.testng.internal.thread.ThreadUtil.lambda$execute$0(ThreadUtil.java:58)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.lang.Thread.run(Thread.java:833)`

Facing the same issue.

I'm to have this problem
Java
Appium v1.22.3
Run for Apple M1 v13.3.1 (a)
Testing mobile platform: Android use Emulator

the issue will be fixed by #1908

is there anyway we can use this commit ?

@amnajamshaid add below given code in POM.xml.

<repositories>
        <repository>
            <id>jitpack.io</id>
            <url>https://jitpack.io</url>
        </repository>
    </repositories>

then add below lines:

        <dependency>
            <groupId>io.appium</groupId>
            <artifactId>java-client</artifactId>
            <version>9c18b2f</version>
        </dependency>

but as of now i'm getting error with given commit id.

<groupId>io.appium</groupId>

Another groupId should be used for Jitpack builds:
<groupId>com.github.appium</groupId>

@valfirst

<repositories>
        <repository>
            <id>jitpack.io</id>
            <url>https://jitpack.io</url>
        </repository>
    </repositories>

<dependency>
		<groupId>com.github.appium</groupId>
		<artifactId>java-client</artifactId>
		<version>9c18b2ff3c</version>
    </dependency>

I have added this in pom but still getting error

Could not find artifact com.github.appium:java-client:pom:9c18b2ff3c in jitpack.io (https://jitpack.io)

@valfirst same error:

The following artifacts could not be resolved: com.github.appium:java-client:jar:9c18b2ff3c (absent): Could not find artifact com.github.appium:java-client:jar:9c18b2ff3c in release-http-unblocker

@SrinivasanTarget has agreed to make a release.

Jitpack builds are broken, the fix is created: #1911

can any one guide me on how to use the above fix 1911. I am stuck with the same issue from morning or please suggest work around till this one is fixed?

I am facing the same issue.
Java client build version - v8.3.0
Appium server version - v2.0.0-beta.66
Desktop OS/version used to run Appium if necessary: Apple M1 Pro 13.3.1 (a)
Node.js version : Node.js v16.16.0
Mobile platform/version under test: Android

Please use the latest version 8.5.0

The fix "#1911" is working.

Upgraded the Appium Java client to 8.5.0
Selenium Java client to 4.9.1

It is working now. Thanks @valfirst @saikrishna321

issue fixed now, Thanks @valfirst @saikrishna321

The fix "#1911" is working.

Upgraded the Appium Java client to 8.5.0 Selenium Java client to 4.9.1

It is working now.

It's for Gradle ?
Because I can't update 8.5.0 for Maven. Maybe you have guide how update Java Client 8.5.0 for Maven?

I am getting the same issue when I put the dependency of Selenium Support to execute WebDriverWait in my code. After that I am getting the same error and unable to run any test case.

Appium ava client build version - v8.5.0
Appium server version - v2.0.0-beta.66
Mobile platform/version under test: Android
Java Selenium - 4.9.1
Java Selenium support - 4.8.3
Testng - 7.7.1

Please help to resolve the issue.

For Me issue got fixed, some server side error was coming due to hideKeyboard function.
v8.5.0 solved the problem.

Thank you guys. The Issue fixed after upgrading Appium Java client to 8.5.0

has same issue
resolved using taking the latest java client library

io.appium java-client 9.0.0