Android Studio Chipmunk fails to build and run tests in parallel on multiple emulators

483 Views Asked by At

I just upgraded Android Studio to Chipmunk | 2021.2.1 Patch 1 (detailed version below). When I run tests on one emulator and then try to start tests on another the build fails.

I noticed that building tests for the second emulator gradle is trying to access test-result.pb file in the same folder as already created for the first emulator. Te file is being used, so access is refused, so build fails.

How to solve this and allow AS to run tests in parralel on multiple emulators? (It worked perfectly on up to 7 emulators in previous version, before the upgrade).


Example:

The emulator running first is named "23-xxhdpi-small".
The emulator to receive tests next is named "29-560dpi-big": You can see the name of the first emulator in the path below.

This is how the error logs:

FAILURE: Build failed with an exception.

What went wrong: Execution failed for task ':app:connectedDevDebugAndroidTest'. java.nio.file.FileSystemException: C:\MyApp\app\build\outputs\androidTest-results\connected\flavors\dev\23-xxhdpi-small(AVD) - 6.0\test-result.pb: The process cannot access the file because it is being used by another process."


AS detailed version:

Android Studio Chipmunk | 2021.2.1 Patch 1 Build #AI-212.5712.43.2112.8609683, built on May 18, 2022 Runtime version: 11.0.12+7-b1504.28-7817840 amd64 VM: OpenJDK 64-Bit Server VM by Oracle Corporation Windows 10 10.0 GC: G1 Young Generation, G1 Old Generation Memory: 4096M Cores: 16 Registry: external.system.auto.import.disabled=true, search.everywhere.settings=true Non-Bundled Plugins: Lombook Plugin (211.7628.21), org.jetbrains.kotlin (212-1.7.10-release-333-AS5457.46)

0

There are 0 best solutions below