TouchAction not working with java-client 6.0.0 version and above in Appium

Hi

I am unable to use TouchAction for tapping on screen with co ordinates with java-client version 6.0.0 and above and used respective selenium-java version
Getting below issue while compiling .

method io.appium.java_client.TouchAction.tap(io.appium.java_client.touch.TapOptions) is not applicable
(actual and formal argument lists differ in length)
method io.appium.java_client.TouchAction.tap(io.appium.java_client.touch.offset.PointOption) is not applicable
(actual and formal argument lists differ in length)

Please let me know any solutions and help me on this to get rid of this issue.

Thanks
Dinesh B M

Make sure to use the latest implementation of touch function which is:

TouchAction touchAction = new TouchAction(driver);
touchAction.tap(PointOption.point(xPoint, yPoint)).perform();

Also another problem that I experienced when I got exactly those errors, was that gradle didn’t actually import the latest versions of java-client, when I checked the libraries the old one was still there, I had to manually remove if from the project and then refresh the gradle project to force it to install the 7.0.0 version after that the pointOption finally worked. Hope this helps.

image
Hi, i used your solution but getting this error,

Hi, I’m new to learning appium. I’m getting errors while using “Tap”, “TouchAction”, “swipe” etc.
Appium Version: 1.22.0
Java Client: 8.0.0 beta
Selenium-Java 4.1.0

Should I downgrade any version? or have any alternate solution?