question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

androidTest fails in new Android Studio Chipmunk release 2021.2.1

See original GitHub issue

Technical 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:closed
  • Created a year ago
  • Comments:10 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
MikeMcC399commented, May 30, 2022
  • This issue is resolved in release 2.24 through PR #5238. The message 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.

1reaction
MikeMcC399commented, May 18, 2022

@thorbenkuro

Thanks for cross-checking this issue. With Chipmunk the error Duplicate content roots detected: is always reproducible. I found though that the other error

com.google.testing.platform.RunnerImpl run
SEVERE: Test execution failed with fatal error!

does 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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Android Studio 2021.2.1 Closed Issues
I am constantly getting this error when the debugger is connected on the latest version of Android Studio. Issue #219563755. New Network ...
Read more >
Android Studio Chipmunk fails to build and run tests in parallel ...
I just upgraded Android Studio to Chipmunk | 2021.2.1 Patch 1 (detailed version below). When I run tests on one emulator and then...
Read more >
Shared srcDirs between test and androidTest, unresolved ...
Shared srcDirs between test and androidTest, unresolved references after upgrade to Android Studio Chipmunk (IntelliJ 2021.2.1). 48. Hotlists ...
Read more >
Android Studio Chipmunk | 2021.2.1 Patch 2 now available
Android Studio - Chipmunk | 2021.2. 1 Patch 2 is now available in the Stable channel. If you already have an Android Studio...
Read more >
SOLVED - Unable to YYC compile Android application
Hi, I recently updated to the latest version of Gamemaker with my ... I tried to update Android Studio and the SDKs, but...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found