Not able to swipe from left to right in native android

I am trying to delete an item by swiping from left to right in an android app. I also made use of the Enable Pointer location from the android mobile, just to make sure the coordinates are correct. After running the test, I see that the coordinates are correct, and the code is also passed but nothing happens on the UI. Here is the code:

int startY = (int) (dimension.height 0.153);
System.out.println(“startY:” + startY);
int startX = (int) (dimension.width
0.85);
System.out.println(“startX:” + startX);
int endX = (int) (dimension.width * 0.50);
System.out.println(“endX:” + endX);
new TouchAction(driver)
.press(PointOption.point(startX, startY))
.waitAction(WaitOptions.waitOptions(Duration.ofMillis(10)))
.moveTo(PointOption.point(endX, startY))
.release()
.perform();

}

Let me know what am I doing wrong here. Thanks

@Aleksei : Kindly look into the issue and suggest.

@Telmo Cardoso: Kindly look into the issue and suggest

@Mohan_Mukherjee try to increase waitAction and add it also on end.

new TouchAction(driver)
.press(PointOption.point(startX, startY))
.waitAction(WaitOptions.waitOptions(Duration.ofMillis(50)))
.moveTo(PointOption.point(endX, startY))
.waitAction(WaitOptions.waitOptions(Duration.ofMillis(50)))
.release()
.perform();

@Aleksei: Thanks for replying. I did try increasing the wait time, but it did not work and even tried with hardcoded coordinates, that too did not work.
Here is the code for swipe using Javascript Executor, it did not work too. Let me know if there is anything wrong with the code:

JavascriptExecutor js = (JavascriptExecutor) driver;
Map<String, Object> params = new HashMap<>();
params.put(“duration”, 2.0);
params.put(“fromX”, dimension.width 0.85);
params.put(“fromY”, dimension.height
0.153);
params.put(“toX”, dimension.width 0.50);
params.put(“toY”, dimension.height
0.153);
params.put(“element”, editBtn.get(i));
js.executeScript(“mobile: dragFromToForDuration”, params);

Also, let me know if there is any other way to swipe?

Thank you

@Mohan_Mukherjee if you enabled to see pointer location in debug menu and see that happens correctly…