Unable to click Permisson Allow though AUTO_GRANT_PERMISSIONS,"true"


After reading post and trying I am still not able to click on Allow permission button.

Client - 6.1.0
Appium Server - 1.8

I get the below in logs
e[36minfoe[39m: [debug] Error: abcd/.MainActivity never started. Current: com.google.android.packageinstaller/com.android.packageinstaller.permission.ui.GrantPermissionsActivity
at [object Object]. (C:\Program Files (x86)\Appium\node_modules\appium\node_modules\appium-adb\lib\adb.js:1314:12)
at [object Object]. (C:\Program Files (x86)\Appium\node_modules\appium\node_modules\appium-adb\lib\adb.js:1258:7)
at [object Object]. (C:\Program Files (x86)\Appium\node_modules\appium\node_modules\appium-adb\lib\adb.js:180:9)
at ChildProcess.exithandler (child_process.js:742:7)
at ChildProcess.emit (events.js:110:17)
at maybeClose (child_process.js:1016:16)
at Process.ChildProcess._handle.onexit (child_process.js:1088:5)

@Aleksei s u mentioned in post Unable to click device's location permission dialog Allow/Deny button in Android using Appium did try the same can you
please advise.

Also @Aleksei Does Capability order impact? I have current now defined…
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(MobileCapabilityType.FULL_RESET,“true”); FEW Capabilities… defined an at end I have the grant permisssion

Did you try to launch permission activity in package installer?
I think you can launch it via adb. I wonder what command issued to launch the activity.

If you set noReset, the autoGrantPermission does not work. => http://appium.io/docs/en/writing-running-appium/caps/
For instance, we can allow runtime permissions for https://github.com/googlesamples/android-RuntimePermissions/tree/master/kotlinApp with the autoGrantPermission: true.

Thanks @KazuCocoa
R u refering too
capabilities.setCapability(“appWaitActivity”, “.permission.ui.GrantPermissionsActivity”);
I did try this as mentioned by @Aleksei in one the links but did not work I have Android 6.0 at my end.
I will look into the links that u have shared.

@vsharma order = no matter. Check appium logs to see adb command that grands all permissions to your app. You can execute it manually, check how it works and maybe share here.

Hi @KazuCocoa
I added the below in the capability section what I saw in logs
Kept rest same
Then I added click event for Allow button and it worked.


Thanks @Aleksei for support as alwz.
As commented above added the capability and it worked.