I'm currently using Android Studio to develop a multi-module project by test-driven-development methods. It went well until I updated my IDE to Android Studio Chipmunk from previous Bumblebee. When I opened the project after the update, it seemed that AS automatically generated some modules for me. As you can see in the pic, those new names such as [main] and [unitTest] appeared in the project view automatically. modules generated automatically
After this, I found that the classes and methods of my production code could not be resolved in my test code. AS told me after I pressed Alt+Enter that I should add dependency to the main module of my production code. And it added one line in the build.gradle file: "testImplementation project(path: ':app')". After syncing the gradle build, nothing had changed and it still could not resolve methods in my production code. I can still run the tests by executing gradle test tasks, but it is weird that I cannot use production code in my test code directly.
UPDATE:
For further information, I think this is a problem caused by the update from Intellij 2021.1 to 2021.2, since I re-installed AS Bumblebee and all seems worked fine. I also found this issue in JetBrains YouTrack that has an exactly same problem with me. Here is the link: https://youtrack.jetbrains.com/issue/IDEA-275566/Class-not-found-after-intellij-upgrade-2021-1-2-2021-2
This issue remains open and I've tried some other developers' reply in this issue to delete the .iml files, but the problem remains. I think Intellij 2021.1 and 2021.2 generate different .iml file in the .idea folder.