Open DonJogi opened 4 years ago
Same error anyone found the solution?
There is workaround: Grant manually permissions to Orchestrator for user 10. adb shell pm grant android.permission.WRITE_EXTERNAL_STORAGE --user 10 Androidx.test.orchestrator adb shell pm grant android.permission.READ_EXTERNAL_STORAGE --user 10 Androidx.test.orchestrator
Description
The Androidx Test Orchestrator fails to run on an Automotive Emulator because it fails to grant the requested runtime permissions (permission.WRITE_EXTERNAL_STORAGE, permission.READ_EXTERNAL_STORAGE).
Steps to Reproduce
./gradlew connectedAndroidTest
Expected Results
The tests should run
Actual Results
The test orchestrator crashes and no tests are executed. Logcat:
AndroidX Test and Android OS Versions
Android Automotive 9 / Polestar Emulator Android Test Orchestrator 1.2.0 (also tested without success on 1.3.0-alpha04)
Link to a public git repo demonstrating the problem:
Not dependent on the app code, but on the Automotive emulator.
Debug
I think this crash occurs because the Automotive emulator has two users set up, whereas a standard Android emulator only has one user. On Automotive,
adb shell pm list users
prints:On standard Android,
adb shell pm list users
prints:I suspect that when the AndroidTestOrchestrator tries to grant the needed runtime permissions, these get assigned to the wrong user (ID 0), while it should be the user with ID 10.