Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SharedTest got warning "Duplicate content root detected" on Android Studio Chipmunk

After upgrade to Android Studio Chipmunk, my test failed because I can't access file inside shared folder that defined in build.gradle like this.

sourceSets {
    androidTest.java.srcDirs += "src/sharedTest/java"
    test.java.srcDirs += "src/sharedTest/java" }

It show warning pop up with message "Duplicate content root detected". Path [sharedTest] of module [unitTest] was removed from modules [androidTest]. Anyone can resolve this?

like image 951
Ahmad Arif Faizin Avatar asked Dec 07 '25 16:12

Ahmad Arif Faizin


1 Answers

According to https://issuetracker.google.com/issues/232007221 ("Duplicate content roots detected" with Android Gradle plugin 7.2.0) Google no longer supports this construct in Android Studio Chipmunk 2021.2.1.

https://issuetracker.google.com/issues/232007221#comment17 says "Source sets can no longer contain shared roots as this is impossible to represent in the IDE."

To follow the on-going discussions, subscribe to https://issuetracker.google.com/232007221 and
https://issuetracker.google.com/232420188

like image 122
MikeMcC399 Avatar answered Dec 10 '25 21:12

MikeMcC399