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 { += "src/sharedTest/java" += "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?


According to ("Duplicate content roots detected" with Android Gradle plugin 7.2.0) Google no longer supports this construct in Android Studio Chipmunk 2021.2.1. 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 and

Answered By – MikeMcC399

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published