Android Studio Run/Debug configuration error: Module not specified

I am getting a 'Module not specified' error in my run config. I have no module showing in the drop down yet I can see my module no probs. The issue came about when I refactored my module name, changed the settings.gradle to new name.

Now when I go to project structure and select my module nothing shows in the screen, not even an error.

I'm not 100% sure, but the icon beside my module looks like a folder with a cup and not a folder with a phone.

My exact steps -

  1. Open in Android view
  2. Refactor directory name
  3. refactor module name
  4. change settings.gradle contents: name to new name

Solution 1:

Resync your project gradle files to add the app module through Gradle

  1. In the root folder of your project, open the settings.gradle file for editing.

  2. Cut line include ':app' from the file.

  3. On Android Studio, click on the File Menu, and select Sync Project with Gradle files.

  4. After synchronisation, paste back line include ':app' to the settings.gradle file.

  5. Re-run Sync Project with Gradle files again.

Solution 2:

never mind, i changed the name in settings.gradle and synced and then changed it back and synced again and it inexplicably worked this time.

Solution 3:

Try to delete the app.iml in your project directory and restart android studio

Solution 4:

This issue also may happen when you just installed new Android studio and importing some project, in the new Android studio only the latest sdk is downloaded(for example currently the latest is 30) and if your project target sdk is 29 you will not see your module in run configuring dialog.

So download the sdk that your app is targeted, then run Sync project with gradle files.

enter image description here

Solution 5:

You have 3 ways:

  1. Clean Project in Android Studio menu

Build -> Clean Project and use Build -> Rebuild


  1. Remove all the modules in settings.gradle
  • Open settings.gradle project
  • Remove include ':app' and other modules
  • Sync gradle
  • Add include ':app' and other modules
  • Sync gradle again

  1. Remove all code in gradle.properties
  • Open gradle.properties project

  • Remove all code

    org.gradle.daemon=true

    org.gradle.configureondemand=true

    org.gradle.parallel=true

    android.enableBuildCache=true

  • Sync gradle

  • Add code again

  • Sync gradle again