appium / java-client

Java language binding for writing Appium Tests, conforms to W3C WebDriver Protocol
Apache License 2.0
1.22k stars 758 forks source link

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. #1907

Closed kuldeep04 closed 1 year ago

kuldeep04 commented 1 year ago

Description

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

Environment

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)`
amnajamshaid commented 1 year ago

Facing the same issue.

OleksandrMoroz commented 1 year ago

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

valfirst commented 1 year ago

the issue will be fixed by #1908

amnajamshaid commented 1 year ago

is there anyway we can use this commit ?

kuldeep04 commented 1 year ago

@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.

valfirst commented 1 year ago

<groupId>io.appium</groupId>

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

amnajamshaid commented 1 year ago

@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)

kuldeep04 commented 1 year ago

@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

saikrishna321 commented 1 year ago

@SrinivasanTarget has agreed to make a release.

valfirst commented 1 year ago

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

Mahee17 commented 1 year ago

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?

nirmohpatel commented 1 year ago

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

saikrishna321 commented 1 year ago

Please use the latest version 8.5.0

Mahee17 commented 1 year ago

The fix "https://github.com/appium/java-client/pull/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

kuldeep04 commented 1 year ago

issue fixed now, Thanks @valfirst @saikrishna321

OleksandrMoroz commented 1 year ago

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?

valfirst commented 1 year ago

@OleksandrMoroz please find snippets here: https://central.sonatype.com/artifact/io.appium/java-client/8.5.0

laksh3199 commented 1 year ago

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.

laksh3199 commented 1 year ago

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

ashwil-avinash01 commented 1 year ago

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

Rashmi94 commented 9 months ago

has same issue resolved using taking the latest java client library

io.appium java-client 9.0.0