[FIXED] Android Studio Mark Directory as Test Sources Root


I’ve done something in build.gradle to remove the green highlighting of the androidTest.java package.

I don’t know how to get it back.

IntelliJ has a “Mark directory as test sources root” option in the context menu but I can’t find the equivalent in Android Studio.

Is there a way to define this folder so I can start testing?
(If it means anything, the test java files all have an icon of a “J” with a red circle around it)


You can click on the folder and type Cmd + Shift + a to enter the action search and then by typing Mark directory as you will get the menu.

Answered By – Diego Villacis

Answer Checked By – Marilyn (Easybugfix Volunteer)

Leave a Reply

(*) Required, Your email will not be published