I had the same problem. I saw that the “main”-code was missing from the Android project-view.
- I changes “kotlin” to “java” under main -> It appeared under Android project view
- Then I invalidated caches and restarted (file > Invalidate caches / restart > Invalidate and restart) -> Did not help
- Run a full git clean “git clean -fdx”, and then a “gradle sync” -> I could build