Search code examples
gradleandroid-espressogradle-managed-device

Android Gradle Managed Devices - Unable to Retrieve Device Error


When trying to run multiple gradle managed devices, on one machine we get the error "Unable to retrieve 2 devices, only 1 available. Proceeding to run tests on 1 shards."

Running using this command

./gradlew pixel4api30DebugAndroidTest -Pandroid.testInstrumentationRunnerArguments.class=com.upmc.enterprises.myupmc.Suites.CITestSuite -Pandroid.experimental.androidTest.numManagedDeviceShards=2 --enable-display --info -Pandroid.testoptions.manageddevices.emulator.gpu="swiftshader_indirect"

What causes this error? How to fix? It is only spawning up 1 device instead of 2.

We are using 32GB machines so it should have enough memory.


Solution

  • Try manually deleting the contents of the .android/avd/gradle-managed-devices folder

    enter image description here