Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Run Button is Disabled in Android Studio

People also ask

Can t run app Android Studio?

Unplug your device from the USB port on the computer. Restart the device by powering off and back on. Verify that Settings => Developer options => USB Debugging is enabled. Quit and re-launch Android Studio.

How do I check if an android button is disabled?

ImageButton myButton = (ImageButton) findViewById(R. id. epic_button); if (myButton. isEnabled()){ //then the button is enabled. }


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.


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.


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


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


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


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


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.