Appium hangs while executing scripts in Android Oreo device

Hi All, While executing appium scripts in Android Oreo, appium gets hanged. Same scripts are running properly with Android 6. We have upgraded appium version from 1.71 to 1.72.

We’re also facing this issue, after few steps of execution, Appium just hangs while detecting an element

“automationName” in your Appium’s capabilities?

capabilities.setCapability("automationName ", “UiAutomator2”);

This is still happening on Appium 1.10.0 with automation name as UiAutomator2. -But in rare cases and I can not find pattern why and when it happens.

Any solutions?