Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4072 pages
Flutter and app store releases

Android Studio run configuration shows 'Module not specified'

ErrorError: Module not specified

Short answer

The Android App run configuration has an empty Module field, so Android Studio does not know what to launch. Open Run, Edit Configurations, and choose your app module in the Module drop-down. If the module you need is not offered there, it is not part of your Gradle build and needs to be included.

  • Applies to Android Studio, Android Gradle plugin 8.x
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Fix it fast

  1. 1Find out which cause you have

    Open the configuration and look at the Module field. If it is blank, set it. If your app module is not offered, go to the second cause.

    Run > Edit Configurations... > Android App > Module
  2. 2Match what you see, then jump to its fix

    1. 1The Module field is empty and your app module is offered in the listThe configuration was created or imported without a moduleFix
    2. 2The app module is not offered in the Module field and is not listed in settings.gradleThe app module is not in the Gradle build, so no module existsFix

What does the error look like?

  • Error: Module not specified
  • Run/Debug Configurations: Module not specified

Cause 1 of 2

The configuration was created or imported without a module

1Check

Android Studio saves run configurations in the project. A copied .idea folder or a deleted module leaves one pointing at nothing.

grep -rn "module name" .idea/runConfigurations/ 2>/dev/null

2Fix

Select the module in the Module field, then apply. Android's documentation describes this field as the module the configuration applies to.

Run > Edit Configurations > Android App > Module > app > Apply

3Verify

Press Run. The build starts and the app installs.

./gradlew :app:assembleDebug

Confirmed by developer.android.com

Did this fix it?

Cause 2 of 2

The app module is not in the Gradle build, so no module exists

1Check

A module appears only when Gradle includes it. Its name must match an include in settings.gradle(.kts).

cat settings.gradle*

2Fix

Add the module to settings, check it applies com.android.application, then sync the project.

// settings.gradle.kts
include(":app")

3Verify

Sync, and confirm the Gradle task exists.

./gradlew :app:tasks --all | grep assembleDebug

Confirmed by developer.android.com

Did this fix it?

How do I stop it coming back?

  • Do not delete the initially created run configuration; Android's docs recommend keeping it.
  • Do not commit a personal .idea folder; share only the run configurations you mean to share.
  • Sync after any change to settings.gradle.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.

Which stack is behind this page?

Projects of mine built on the same technologies:

Related fixes

Mobile apps

Android Studio cannot pair the phone over Wi-Fi

The Pair devices over Wi-Fi dialog lists no device

Wireless pairing needs the phone on Android 11 or higher and on the same Wi-Fi network as the computer, with current Platform-Tools.

4 causes, each with a fix

Mobile apps

adb tcpip 5555 fails because no device is found

adb: more than one device/emulator

adb tcpip only works while the device is attached and listed by adb, because it tells the phone to start listening on port 5555.

4 causes, each with a fix

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.