EDIT: Updated description and error message and added some images. Still have this problem.
I have a strange error that occur many times when running espresso tests. Af
In my case, the solution was to use the UI Automater
val uiDevice = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation())
uiDevice.findObject(UiSelector().textContains("text")).click()
I wanted to do clicks on an activity hosted by google login SDK. I noticed the activity triggerred by SDK is still visible even when the process of the app under test is killed. So I used UI Automator which is inteded for cross-app functional UI testing