I am unable to scroll down in android emulator using Appium 1.8.1 and Java-client 6.1.0

My code is
new TouchAction((PerformsTouchActions) driver).press(ElementOption.element(monday,monday.getSize().getWidth() / 2,monday.getSize().getHeight() / 2)).waitAction(WaitOptions.waitOptions(Duration.ofSeconds(3))).moveTo(ElementOption.element(tags,tags.getSize().getWidth() / 2,tags.getSize().getHeight() / 2)).release().perform();

I am getting the error:
org.openqa.selenium.remote.RemoteWebDriver cannot be cast to io.appium.java_client.PerformsTouchActions

Any kind of help is appreciated.

to use TouchAction, u need to set driver as parameter, like AndroidDriver, IOSDriver, WebDriver, etc.

e.g.:

TouchAction action = new TouchAction(driver);