Android- After dismissing a popup Appium can't find any element

ENV:
Appium latest 1.6.1
Android 7.1.1

The test works fine however when some of the popups are opened (see below example) the code can dismiss it however afterwards appium can’t find any element.
I suspect that appium “Thinks” that the popup layer is still above the main layer & therefore it doesn’t find any element.
Do notice that on previous android version (5.x) we didn’t face this issue.
is this a known issue with Android 7.x?

I am having the same issue! Previously posted, but have yet to receive a response. Appium users must have some way of dealing with this. Hopefully somebody gets back to you.

I have the same problem with appium 1.6.4 with android 7.x, the element doesn’t get recognize after accepting allow location.

Hello guys,
Please download the java client beta-8
and lastest appium beta client desktop,
After you accept the alert you should use:
driver.runAppInBackground(1);

And then after the app will back from background it will recognize the elements again !!!

I know it’s not perfect, but it’s appium bug !

this workaround is working for me, the location is automatically granted while driver setup.
capabilities.setCapability(“autoGrantPermissions”, “true”);

I see the following in appium log

Running adb with args: ["-P",5037,"-s",“XXXXXX”,“shell”,“pm”,“grant”,“com.testapp.debug”,“android.permission.ACCESS_COARSE_LOCATION”,";",“pm”,“grant”,"“com.testapp.debug”,“android.permission.ACCESS_FINE_LOCATION”,";",“pm”,“grant”,“com.testapp.debug”,“android.permission.RECORD_AUDIO”,";",“pm”,“grant”,"“com.testapp.debug”,“android.permission.GET_ACCOUNTS”,";"]

I have the same problem with appium 1.6.2 with android 7.x, the element doesn’t get recognize after accepting popup and also if i try to inspect the element using appium, it closes unexpectedly. Already raise the ticket but no response yet.