Scrolling need to swipe or find adapter child

he method not recognised i tried as best as i could

This was more promising :-

Dimension dim = driver.manage().window().getSize();

    int height = dim.getHeight();

    int width =dim.getWidth();

    int x = width/2;

    int start_y = (int)(height*0.80);

    int end_y =(int)(height*0.10);

Dimension size = driver.manage().window().getSize();

int anchor = (int) (size.height * anchorPercentage);

int startPoint = (int) (size.width * startPercentage);

int endPoint = (int) (size.width * finalPercentage);

new TouchAction(driver).press(point(anchor, startPoint)).waitAction(waitOptions(ofMillis(2000)))

.moveTo(point(anchor, endPoint)).release().perform();

new TouchAction(driver).press(PointOption.point(startPoint, anchor)).waitAction(WaitOptions.waitOptions(Duration.ofMillis(2000))).moveTo(PointOption.point(endPoint, anchor)).release().perform();


[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Returning result: {“status”:13,“value”:“The swipe did not complete successfully”}

[AndroidBootstrap] Received command result from bootstrap

[MJSONWP] Matched JSONWP error code 13 to UnknownError

[W3C (cf9e30f9)] Encountered internal error running command: UnknownError: An unknown server-side error occurred while processing the command. Original error: The swipe did not complete successfully

[W3C (cf9e30f9)] at errorFromMJSONWPStatusCode (C:\Program Files\Appium\resources\app\node_modules\appium\node_modules\appium-base-driver\lib\protocol\errors.js:789:10)

[W3C (cf9e30f9)] at (C:\Program Files\Appium\resources\app\node_modules\appium\node_modules\appium-android-driver\lib\bootstrap.js:139:18)

[W3C (cf9e30f9)] at Socket.emit (events.js:182:13)

[W3C (cf9e30f9)] at addChunk (_stream_readable.js:279:12)

[W3C (cf9e30f9)] at readableAddChunk (_stream_readable.js:260:13)

[W3C (cf9e30f9)] at Socket.Readable.push (_stream_readable.js:219:10)

[W3C (cf9e30f9)] at TCP.onread (net.js:636:20)

[HTTP] <-- POST /wd/hub/session/cf9e30f9-187e-4e4a-8d9a-ee4028fbb09c/touch/perform 500 22 ms - 889


I HEARD THAT IT WORKS WITH UIAUTOMATOR2 BUT when i tried this below the appium gui i had didn’t do anything it failed!!!

//cap.setCapability(MobileCapabilityType.AUTOMATION_NAME, “UiAutomator2”);

anyone tell me how you can setup uiautomator2 ??
I tried the below and whilst it worked for the little appium app because text is defined it didn’t work at work just scrolled past the element anyone tell me how i can stop it scrolling past or just do so for one iteration?
driver.findElementByAndroidUIAutomator(“new UiScrollable(new UiSelector().scrollable(true).instance(0)).scrollIntoView(new UiSelector().textContains(”"+ str + “”).instance(0))");