wiz
wiz

Reputation: 2977

Run Button is Disabled in Android Studio

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

Disabled Run Button

Upvotes: 179

Views: 178078

Answers (30)

David Ko
David Ko

Reputation: 177

Very silly, but for me the reason was that in Android studio I opened the whole react native project although should have been opened it's 'android' subfolder which contains those very importand gradle files. After I opened the correct folder run button became active and I didn't even had to edit configurations as it is said in accepted answer.

Upvotes: 0

Ricardo Araque
Ricardo Araque

Reputation: 81

Worked for me using Android studio on flutter project:

File > Repair IDE

After an alert "Repair IDE" appears asking if the IDE already works fine, press Rescan Projects Indexes untill the run button works fine

Upvotes: 2

Özer Bayraktar
Özer Bayraktar

Reputation: 61

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

Upvotes: 0

muneeb
muneeb

Reputation: 21

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

Upvotes: 1

Ziku
Ziku

Reputation: 461

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.

Upvotes: 0

muneeb
muneeb

Reputation: 21

  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

Upvotes: 1

Julian A.
Julian A.

Reputation: 11450

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

Upvotes: 0

Fardeen Ahmed Mansur
Fardeen Ahmed Mansur

Reputation: 71

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.

Upvotes: 7

Grim Meek
Grim Meek

Reputation: 1

go to Build-> Clean Project

Upvotes: 0

Fakhar Iqbal
Fakhar Iqbal

Reputation: 4069

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

Upvotes: 9

Abhishek Kumar
Abhishek Kumar

Reputation: 4808

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.

Upvotes: 0

Shiwantha Viraj
Shiwantha Viraj

Reputation: 331

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

Upvotes: 6

yoAlex5
yoAlex5

Reputation: 34245

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

Upvotes: 0

Devinder Jhinjer
Devinder Jhinjer

Reputation: 655

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

Upvotes: 2

Khaled Mahmoud
Khaled Mahmoud

Reputation: 302

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).

Upvotes: 0

Linh
Linh

Reputation: 60923

Build->Clean Project

make the run button enable again in my case

Upvotes: 2

Zaid Pathan
Zaid Pathan

Reputation: 16820

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

enter image description here

Upvotes: 2

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

Upvotes: 1

Scarlet Scherzinger
Scarlet Scherzinger

Reputation: 251

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

Upvotes: 2

Pruthwiraj Nayak
Pruthwiraj Nayak

Reputation: 311

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...

Upvotes: 19

saigopi.me
saigopi.me

Reputation: 14918

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

Upvotes: 45

Richard Lindhout
Richard Lindhout

Reputation: 2068

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

Upvotes: 1

Carlos Valdez
Carlos Valdez

Reputation: 129

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

Upvotes: 0

Big Pumpkin
Big Pumpkin

Reputation: 4467

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.

Upvotes: 139

Sumit
Sumit

Reputation: 1122

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

Upvotes: 5

Jasper de Vries
Jasper de Vries

Reputation: 20188

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!

Upvotes: 0

Akhil MG
Akhil MG

Reputation: 52

  • 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.

Upvotes: 1

Nikunj Acharya
Nikunj Acharya

Reputation: 797

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

Upvotes: 33

Dan Levin
Dan Levin

Reputation: 714

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.

Upvotes: 4

the_legend_27
the_legend_27

Reputation: 571

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.

Upvotes: 2

Related Questions