Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Instrumented test execution with ANDROIDX_TEST_ORCHESTRATOR does not work with Android 11 #743
Comments
I am also experiencing this bug. I also made a test application that experiences the same indefinite hanging on Android 11: https://github.com/prfarlow1/UiTestApplication |
Same issue is occurring when compiling and targeting SDK 30 and running against an emulator with 30.
|
Can we get an update from the Android test team when this will be addressed? This is a really bad bug. We rely on the orchestrator for our tests to pass and right now we just can't run our tests on Android 11 test devices. |
Same here. Everything was working fine with emulator api 29 and Orchestrator until we migrated to api 30. |
Hey all, sorry for delayed response. We are looking into this, but the fix is proving more difficult to get released than anticipated. We hope to have something out soon to address this. |
Same here. Switched to Android 10 and it's working fine for me. |
Please give 1.3.1-alpha01 a try. This should hopefully be fixed. |
Can't confirm it works :/ It doesn't hang indeed, but still fails with a message:
Failed run: |
I also could not get my tests to work with the new 1.3.1-alpha01 |
It looks like there is an incompatibility with the testInstrumentationRunnerArguments clearPackageData: 'true' setting. I was able to get @mateuszkwiecinski sample working by commenting out that line. |
Enable clearPackageData
A workaround for the clearPackageData issue is to declare a application android:forceQueryable="true" in the androidTest manifest |
What does android:forceQueryable="true" actually do? I can't find any documentation for it |
Check out the docs on the new package visibility restrictions on API 30 here IIUC using forceQueryable basically lets other apps (like the orchestrator app) communicate with the test package. |
This fixes using 'clearPackageData' on API 30 by making test apps (that build androidx.test.runner) callable from androidx.test.orchestrator. Fixes #743 PiperOrigin-RevId: 337944463
This fixes using 'clearPackageData' on API 30 by making test apps (that build androidx.test.runner) callable from androidx.test.orchestrator. Fixes #743 PiperOrigin-RevId: 337944463
Please give 1.3.1-alpha02 a try |
Thank you @brettchabot |
whew thanks for confirming @mateuszkwiecinski |
|
@tadfisher can you be more specific about your project setup? I don't know where a 'AAPT2 4.1.0' comes from. The aapt2 version in build tools 30.0.2 appears to be |
@brettchabot My bad, this is on a nonstandard setup using aapt2 from maven.google.com. With the |
@tadfisher cool thanks for confirming. |
@brettchabot Just in case if that's related: I faced another issue with 1.3.1-alpha02 - our tests don't fail anymore. Apparently new alpha version changes when |
Description
Similar to #355, but the execution hangs
Steps to Reproduce
Expected Results
The test passes
Actual Results
mkdir: ‘/storage/emulated/0/Android/data/my.app.package’: Permission denied
which points atDeviceProviderInstrumentTestTask
andgetAdditionalTestOutputEnabled
which tries to save some log file. disabling theandroid.enableAdditionalTestOutput
property removes themkdir
error but the test still hangsAndroidX Test and Android OS Versions
Android OS Versions: the issue exists only on API 30. The test passes on lower apis.
Link to a public git repo demonstrating the problem:
https://github.com/mateuszkwiecinski/orchestrator_doesnt_work

task:
./gradlew connectedDebugAndroidTest
hangs and never endsGithub action run confirming the issue: https://github.com/mateuszkwiecinski/orchestrator_doesnt_work/pull/1/checks?check_run_id=1119649523