Android Studio: Module won't show up in "Edit Configuration"

I've imported a project to Android Studio with several subprojects.

I want to run a subproject.

I successfully made this subproject's build.gradle as a module.

In order to run it, I went to Run > edit configurations > + > Android Application.

Problem: When I try to select a module, none show up in the drop down list.

Why is this?

EDIT: it shows up as a module under Groovy but not showing under Android Application. How do I get it to show up under Android Application?


Make sure your build.gradle is

apply plugin: 'com.android.application'

not

apply plugin: 'com.android.library'

After you have changed, please sync your gradle again.

enter image description here


I had similar issue when I selected parent directory of my project, I resolved by Close Project -> Delete Project from Android Studio -> Import Project by selecting right build.gradle file.

Make sure you select right build.gradle file while import.