android studio Unsupported Modules Detected: Compilation is not supported for following modules: foobar.

How to fix when this warning displays on Android Studio every time.

Unsupported Modules Detected: Compilation is not supported for following modules: common_library. 
Unfortunately you can't have non-Gradle Java modules and Android-Gradle modules in one project.

Cause and solution

It’s maybe android studio’s bug.
The solution is

  1. Close the project.
  2. Close Android Studio IDE.
  3. Delete the .idea directory.
  4. Delete all .iml files.
  5. Open Android Studio IDE and import the project

dev

Posted by sakony