Appium cannot allow permissions when Target SDK is 22 or lower and is running in Android 10 (API level 29) or higher
See original GitHub issueThe problem
When I try to run Appium with an APK with a Target SDK equal or lower than 22 and it runs on an emulator or mobile device that has Android 10 (API level 29) or higher it fails to give the respective permissions. Because of this.
Environment
- Appium version (or git revision) that exhibits the issue: 2.2.0
- Desktop OS/version used to run Appium: Windows 10
- Mobile platform/version under test: Android 10 (API Level 29)
- Real device or emulator/simulator: Pixel 4a
- Appium CLI or Appium.app|exe: Appium-Python-Client
Details
Error in console:
Message: An unknown server-side error occurred while processing the command. Original error: Cannot start the 'com.notriddle.budget' application. Visit https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/android/activity-startup.md for troubleshooting. Original error: '*' or 'com.notriddle.budget.*' never started. Visit https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/android/activity-startup.md for troubleshooting
Stacktrace:
UnknownError: An unknown server-side error occurred while processing the command. Original error: Cannot start the 'com.notriddle.budget' application. Visit https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/android/activity-startup.md for troubleshooting. Original error: '*' or 'com.notriddle.budget.*' never started. Visit https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/android/activity-startup.md for troubleshooting
at getResponseForW3CError (C:\Users\dvalb\AppData\Roaming\npm\node_modules\appium\node_modules\appium-base-driver\lib\protocol\errors.js:804:9)
at asyncHandler (C:\Users\dvalb\AppData\Roaming\npm\node_modules\appium\node_modules\appium-base-driver\lib\protocol\protocol.js:380:37)
Screen in the emulator when the error is generated:
The execution was tested with this app, but the same happens with any app with a target sdk equal to or less than 22.
Issue Analytics
- State:
- Created a year ago
- Comments:8 (6 by maintainers)
Top Results From Across the Web
Behavior changes: apps targeting API 29+ - Android Developers
These changes, which affect apps that target API level 29 or higher, enhance user privacy. To learn more about how to support these...
Read more >Appium no longer working with an AVD after latest Android ...
This has been occuring on a Windows 10 machine, running Android Studio 3.4.1 and using Android SDK 29.0.0, and running Appium 1.13. My...
Read more >Bypass Android's hidden API restrictions - Stack Overflow
2: Disallow usage of non-SDK interfaces that belong to either the blacklist or the greylist and are restricted for your target API level....
Read more >Working With Android 10 - HeadSpin
While testing an app with an SDK version less than 23 on Andriod 10, you will see a permission interstitial before launch.
Read more >Appium Tutorial Step by Step Appium Automation
Let's go to Android Studio Download and install Android Studio. After that, apply the following steps. Click the “Next” icons and finally click ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
oh, sorry, it could be confused.
-g
is added by Appium when you haveappium:autoGrantPermissions: true
for android 6+ device in the app installation 😃Only installation
-g
option helped for target sdk is lower than and equal to 22 in current Android OS’s behaviors.So far,
"appium:fullReset": true
andappium:autoGrantPermissions: true
helps for your current combination, or you should start a session without app, then install the app/start the app and launch the app. Then, you need to allow the permission with find element the ‘Continue’ and click it in your test scenario.Android OS gives permissions information to Appium to grant permissions against installed app over target sdk 23 as https://github.com/appium/appium-adb/blob/ecf8dfd975c23cff7300047756c59cc2808a063a/lib/tools/adb-commands.js#L332, but lower than the version cannot know such into.