I found a nice solution that works great
we can click on recent app , and click on clear all button
with
driver.pressKey(new KeyEvent().withKey(AndroidKey.APP_SWITCH));
and
I used the position of the button
Because it does not recognize the element
TouchAction touchAction = new TouchAction(driver);
touchAction.tap(PointOption.point(x, y)).perform();