unsupported modules detected compilation is not supported for following modules android code example

Example 1: Compilation is not supported for following modules: android. Unfortunately you can't have non-Gradle Java modules and Android-Gradle modules in one project

save .idea folder somewhere else (for backup)
remove .idea folder
start AndroidStudio
select project
[there may be an error, ignore that]
click File -> Invalidate Caches/ Restart
click button: Invalidate Caches/ Restart
resolved

Example 2: Unsupported Modules Detected

Delete .idea/modules.xml
Reload All Gradle Projects

Tags:

Java Example