Scrollable function

Could not parse expression new UiScrollable(new UiSelector()).scrollIntoview(text"WebView"): UiScrollable has no scrollIntoview method.

-> https://developer.android.com/reference/androidx/test/uiautomator/UiScrollable

Hi,
I have written the POM classes in my code,I am not able to execute the POM operation,The app is opened but By POM classes operations are not executed.
Please let me know what is the issue

code:
package sampleaPOM.com;

import java.io.File;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.concurrent.TimeUnit;

import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.testng.annotations.BeforeTest;

import io.appium.java_client.AppiumDriver;
import io.appium.java_client.Setting;
import io.appium.java_client.android.AndroidDriver;
import io.appium.java_client.android.AndroidElement;
import io.appium.java_client.remote.MobileCapabilityType;

public class POMandroid1

{

public static AndroidDriver setupDesiredCapabilities() throws MalformedURLException, InterruptedException

{

AndroidDriver driver = null;

// TODO Auto-generated method stub

File appDir = new File(“src”);

 File app = new File(appDir, "ApiDemos-debug.apk");

 

 //set the package and activity name

 DesiredCapabilities capabilities = new DesiredCapabilities();

 capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, "sampleemulator");

capabilities.setCapability(MobileCapabilityType.AUTOMATION_NAME,“uiautomator2”);

capabilities.setCapability(“autoGrantPermissions”, true);

capabilities.setCapability(“noReset”, “false”);

capabilities.setCapability(“fullReset”, “true”);

capabilities.setCapability(MobileCapabilityType.APP, app.getAbsolutePath());

AndroidDriver driver1 = new AndroidDriver<>(new URL(“http://127.0.0.1:4723/wd/hub”), capabilities);

capabilities.setCapability(MobileCapabilityType.NEW_COMMAND_TIMEOUT, 6000);

return driver1;

}

}

package sampleaPOM.com;
import java.net.MalformedURLException;

import java.util.concurrent.TimeUnit;

import org.openqa.selenium.By;

import io.appium.java_client.AppiumDriver;
import io.appium.java_client.android.AndroidDriver;

import io.appium.java_client.android.AndroidElement;
import sampleandroid.com.test1;

public class POMbasics extends POMandroid1

{
public void main(String[] args) throws MalformedURLException, InterruptedException

{

AndroidDriver<AndroidElement> driver = setupDesiredCapabilities();

driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);

driver.findElement(By.xpath("//android.widget.Button[@text='OK']")).click();

Thread.sleep(3000);

POMapphome pomapphome= new POMapphome(driver);

pomapphome.preferences.click();

POMappPreference pomapppreference= new POMappPreference(driver);

pomapppreference.dependencies.click();

}

}

package sampleaPOM.com;

import java.util.concurrent.TimeUnit;

import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.PageFactory;

import io.appium.java_client.AppiumDriver;
import io.appium.java_client.MobileElement;
import io.appium.java_client.android.AndroidDriver;
import io.appium.java_client.android.AndroidElement;
import io.appium.java_client.pagefactory.AndroidBy;
import io.appium.java_client.pagefactory.AppiumFieldDecorator;

public class POMapphome extends POMbasics

{
AndroidDriverdriver;

	public POMapphome(AppiumDriver driver)

{
		
	PageFactory.initElements(new AppiumFieldDecorator(driver), this);
}

@AndroidBy(xpath = "//android.widget.TextView[@text='Preference']")
public MobileElement preferences;

}