170

I can't click the run button. Does anyone know how to fix it?

Disabled Run Button

MMG
  • 3,226
  • 5
  • 16
  • 43
wiz
  • 2,887
  • 5
  • 18
  • 18
  • 3
    Does the drop-down list to the left of the Run button respond? If yes, then you should see an "Edit Configurations" option there, where you can define a run configuration. – CommonsWare Feb 07 '15 at 17:33
  • 4
    Solved! I removed all the projects and created it again. It seemed some problem with directory position. – wiz Feb 07 '15 at 19:26
  • I had to clone the project again from version control system to a new location to make it work. – Reejesh Dec 26 '22 at 13:13

32 Answers32

208

Click Run on the menu and then Edit Configurations... then click on Android Application on the left and click the + button. Choose Android Application from the pop-up menu. Then pick the module (its normally app or something like that). Then click apply and ok.

If you have more errors after that, try to re-import the project in Android Studio.

Thanos
  • 3,627
  • 3
  • 24
  • 35
  • >Then pick the module I tried until here. I could choose Module between (1) (2)AndroidStudioProjects. And I chose (2). Now, the run button is clickable. Thanks! But, now, we get another error after clicking the run button. "Configuration is still incorrect. Do you want to edit it again? [Edit] [Continue Anyway]" and after continuing anyway, "Cannot start compilation: the output path is not specified for module "AndroidStudioProjects". Specify the output path in Configure Project" – wiz Feb 07 '15 at 18:37
  • 6
    In the configuration, "Error: AndroidManifest.xml doesn't exist or has incorrect root tag" – wiz Feb 07 '15 at 18:41
  • Did you try to import the project again? It sounds to me that your gradle configuration is broken. – Thanos Feb 07 '15 at 18:59
  • 2
    I deleted all the projects I had, and created a new one. And it solved :) thanks! – wiz Feb 08 '15 at 18:18
  • 13
    I have downloaded a project but it doesn't have gradle.While edit config displayed. How can I enable Run Button – Vineesh TP Oct 14 '15 at 08:53
  • 2
    Go to Run, then EDIT configurations....Where when you try to find menu in Android Studio 1.3.+ versions – EngineSense Nov 28 '15 at 01:56
  • 10
    there are no modules showing when i select the module option. – Anjani Mittal Nov 13 '18 at 04:28
118

When creating the Run Configuration, the dropdown for Module had only <no module> for me. Invoking menu File -> Sync Project with Gradle Files added app to the dropdown for Module. Then the Run button became enabled.

Big Pumpkin
  • 3,907
  • 1
  • 27
  • 18
52

The above answer didn't work for me, instead closing the project and restaring the AS IDE worked for me.

Driss Bounouar
  • 3,182
  • 2
  • 32
  • 49
37

just to go File -> Sync Project with Gradle files then it solves problem.

saigopi.me
  • 14,011
  • 2
  • 83
  • 54
  • sync with gradle helped me realize that i need to update android studio to be able to run the project. Thx!! – Sam Oct 23 '19 at 16:35
31

Just click the dropdown button on left side of RUN button (in your image the dropdown which is in red box) select 'app' option from that and RUN button will be enabled.

Please refer below screenshot.

enter image description here

varotariya vajsi
  • 3,965
  • 37
  • 39
Nikunj Acharya
  • 767
  • 8
  • 19
  • I already read your answer, but I couldn't understand. Then I Clicked the `Run` option and the `Green Button` which is actually the Run button is enabled, I clicked and select the `App` and it works. Later, I realized that this was what your talking about. You must add Screenshot. LOL – Polar Dec 30 '17 at 14:00
18

for flutter project, if the run button is disabled then you have to

tools>> flutter>> flutter packages get >>enter your flutter sdk path >>finish

This should solve your problem...

7

Run 'app' button disable issue coming sometimes in Android Studio Dolphin

enter image description here

Sync your project with gradle files

enter image description here

Fakhar
  • 3,946
  • 39
  • 35
7

If you are on a Mac, try clicking on File, then click on "Sync project with Gradle files" .... Run button should turn green again in a few seconds.

6

open your existing application by selecting build.gradle file. it will automatically sync the project and run button will be clickable

enter image description here

Shiwantha Viraj
  • 301
  • 3
  • 8
5

Above answer didn't work for me, just do click File -> Invalidate/cache -> Invalidate and Restart.

Sumit
  • 1,022
  • 13
  • 19
4

It was quite silly for me, I just opened the Run > Run Configurations window everything seemed to be fine there, I didn't change anything, when I closed the window the button was enabled.

Generic Bot
  • 309
  • 1
  • 4
  • 8
Dan Levin
  • 718
  • 7
  • 16
3

If you have changed jdk version then go to File->Project Structure->Select SDK Location from left bar->update JDK Location in editbar in right bar.

shripal
  • 1,222
  • 4
  • 19
  • 40
3

If your IDE is in power save mode, then the run button etc. are also disabled.

You can verify this via the file -> power save mode, make sure it is disabled.

Disable power save mode to enable the run button

2

if you're importing an eclipse project to android studio, you'll also encounter the same issue as above. Double Check if grade>app has apply plugin: 'com.android.application' on the top as sometimes android studio imports it as a library.

the_legend_27
  • 571
  • 4
  • 11
2

You have to reconfigure the FlutterSDK path in Android Studio: Go to Setting -> Language & Frameworks -> Flutter and set the path to Flutter SDK

2

I just clicked on the debug icon and it started working.

enter image description here

Mohammad Zaid Pathan
  • 16,304
  • 7
  • 99
  • 130
2

Build->Clean Project

make the run button enable again in my case

Linh
  • 57,942
  • 23
  • 262
  • 279
2

For me increasing the version of compile SDK to latest solved my issue, Go to

build.gradle(app-level)

compileSdkVersion 30

Because My Emulator is Api-level 30

Devinder Jhinjer
  • 645
  • 7
  • 13
1
  • Select the project view in the android studio.
  • Remove all gradle folders.
  • Restart the android studio.

This will work.

The issue is happening since the gradle was configured for an android studio in another machine and the files pushed on the git and are using in your studio.

After removing these gradle files and restarting the studio, the studio will generate gradle files for your system. This will solve the issue.

Akhil MG
  • 54
  • 7
1

I opened the wrong folder.... Verify is your root folder in Android studio has the build.gradle file.

Richard Lindhout
  • 2,038
  • 2
  • 23
  • 38
1

If you are trying to run the Flutter Project in Android Studio, and the run button is disabled then here is the solution

enter image description here

Click on add configuration

enter image description here

and select Flutter and then select the main class in dataentrypoint

1

dart was not enabeld

  1. goto setting search for enable dart or you will see dart option there
  2. enable dart and give it will ask you for the dart SDK path give the path 'C:\src\flutter\bin\cache\dart-sdk' but check your path of the given example directory
  3. choose the below box project file and then apply and ok to exit this will enable your RUN button
muneeb
  • 11
  • 1
0

My solution was to go to that multiselect button, then "Edit Configurations" -> Go to "+" and select the module (in this case it would be an app if you do not have a multiproject -> then apply and OK

Carlos Valdez
  • 129
  • 1
  • 10
0

I'm using Linux where I had a symlink in my home folder pointing to a folder containing the Android Studio projects. Loading a project using the symlink failed, loading a project from the folder where the symlink is pointing to worked!

Jasper de Vries
  • 19,370
  • 6
  • 64
  • 102
0

Happened to me twice, and then I figured out it happened after I upgraded my flutter version. When I opened (flutter SDK path) in (flutter) tab in (system preferences) I found it empty.

Solution was to point out to flutter directory on my disk from (flutter SDK path) in (flutter) tab in (Android studio preferences).

Khaled Mahmoud
  • 302
  • 1
  • 7
  • 16
0

Run button is bounded with Configuration that is why you should check if your project is build, synced and indexed and after that you can select a Configuration

yoAlex5
  • 29,217
  • 8
  • 193
  • 205
0

For me, more than 1 instance of adb was initialized and due to this run button was disabled. I had to open ActivityManager (on mac) and kill all the initialized adb instances.

Abhishek Kumar
  • 4,532
  • 5
  • 31
  • 53
0

go to Build-> Clean Project

0

Selecting a different build variant (in the Build Variants view), then reselecting the initial build variant, fixed this issue for me.

Julian A.
  • 10,928
  • 16
  • 67
  • 107
0
  1. goto android studio terminal and paste flutter packages get
  2. goto Files->Repair IDE if your problem goes away then select the option 'Everything ok or works for me' like option otherwise select other option and the problem goes away
  3. The IDE will restart in the step2 but still if it does not restart then manually restart IDE
Suraj Rao
  • 29,388
  • 11
  • 94
  • 103
muneeb
  • 11
  • 1
0

Most likely an issue with your Flutter config setup in android studio. Go to edit config and check if the flutter path is setup properly. That should fix your problem.

Ziku
  • 431
  • 6
  • 9
0

in my case, in the gradle scripts my local.properties file didnt exist so ide wasnt able to find the location of project.and the reason was, i started the project with dragging file of project to android studio. AFter that i closed the ide and started the project from android studio -> projects side. it worked for meenter image description here