androidTest fails in new Android Studio Chipmunk release 2021.2.1
See original GitHub issueTechnical details
cwa-android branch: release/2.23.x Android Studio Chipmunk | 2021.2.1 Windows 11
Describe the bug
Using the Android Studio Chipmunk release 2021.2.1, classed as “stable” and released on May 9, 2022 (see https://android-developers.googleblog.com/2022/05/android-studio-chipmunk.html) CWA Android release/2.23.x produces the error message Duplicate content roots detected
. Attempting to run androidTests
produces the error message SEVERE: Test execution failed with fatal error!
and it is not possible to run the tests.
This is a regression from the previous stable environment Android Studio Bumblebee | 2021.1.1 Patch 3. It affects build variants
deviceDebug
deviceForTestersDebug
(deviceRelease
and deviceForTestersRelease
do not include androidTest
.)
Steps to reproduce the issue
Android Studio Chipmunk
Build > Select Build Variant: deviceforTestersDebug
File > Sync Project with Gradle Files
Note error message:
Duplicate content roots detected: Path [C:/Users/<user_name>/github/cwa-app-android/Corona-Warn-App/src/testShared/java] of module [Corona-Warn.Corona-Warn-App.unitTest] was removed from modules [Corona-Warn.Corona-Warn-App.androidTest]
Build > Rebuild Project
Run androidTest (Tests in de/rki/coronawarnapp
) on Android 11 device
Note error message:
com.google.testing.platform.RunnerImpl run
SEVERE: Test execution failed with fatal error!
com.google.testing.platform.api.plugin.PluginException: Exception thrown during onBeforeAll invocation of plugin com.google.testing.platform.plugin.android.AndroidDevicePlugin.
Android Studio Bumblebee
For comparison, the identical steps are successful in Android Studio Bumblebee.
Build > Select Build Variant: deviceforTestersDebug
File > Sync Project with Gradle Files
(no error message)
Build > Rebuild Project
Run androidTest (Tests in de/rki/coronawarnapp) on Android 11 device
Status shows 7 failed, 181 passed, 253 tests
Expected behavior
It should be possible to run androidTest
in the stable release of Android Studio, currently the Chipmunk 2021.2.1 version.
Possible Fix
There is a related P1 bug logged on https://issuetracker.google.com/issues/232007221 “Duplicate content roots detected” with Android Gradle plugin 7.2.0", however CWA is using AGP 7.1.3 not 7.2.0.
If this is not fixable in CWA Android, then a note should be added to https://github.com/corona-warn-app/cwa-app-android/wiki/1-Setup which recommends using the latest version of Android Studio. That recommendation should be changed.
Internal Tracking ID: EXPOSUREAPP-13104
Issue Analytics
- State:
- Created a year ago
- Comments:10 (9 by maintainers)
Top GitHub Comments
Duplicate content roots detected:.
is no longer output in Android Studio Chipmunk, 2021.2.1 Patch 1 when performing a “Sync Project with Gradle Files” operation.Closing again, since this is a development-only issue, which does not affect end-users.
@thorbenkuro
Thanks for cross-checking this issue. With Chipmunk the error
Duplicate content roots detected:
is always reproducible. I found though that the other errordoes not always occur. I checked using a physical device, not an emulator.
I have the feeling that Chipmunk is not yet stable. Hopefully there will be a Chipmunk Patch 1 soon and we can recheck the stability. If a patch is going to be released in the next days (similar to the Patch 1 cycle for Bumblebee) then it’s probably not worth updating the Wiki at the moment.