android / android/android-test

PermissionRequester throws java.lang.RuntimeException: Error while connecting UiAutomation on API < 28

Open
#716 0 comments 3 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
1.2k
Forks
342
Avg merge
11h 29m
Merged PRs (30d)
2

Description

### Description
When using `PermissionRequester` in an instrumented test on API < 28, there's a RuntimeException that says "Error while connecting UiAutomation"

### Steps to Reproduce
Create a custom test runner
Request permissions in either `callApplicationOnCreate()` or `callActivityOnCreate()` through `PermissionRequester` API
Run instrumented test on API < 28

### Expected Results
Permission is granted and can be utilized

### Actual Results
Test crashes before even starting

### AndroidX Test and Android OS Versions
Test: 1.2.0
API < 28, tested down to 25

### Link to a public git repo demonstrating the problem:
https://github.com/PaulKlauser/PermissionRequesterCrash

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the crash from the linked public repository with AndroidX Test 1.2.0 on an API below 28. Trace the PermissionRequester calls made from callApplicationOnCreate() or callActivityOnCreate() in the custom test runner. Done means the instrumented test starts without the UiAutomation connection exception and the requested permission is granted.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
mobile, testing-qa
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.