3

I just imported a project from github, and after trying to run the project, I realized the run button was grayed out. In other words, I can't run the project. Does anybody know how to fix this?

RGA
  • 2,577
  • 20
  • 38
miatech
  • 2,150
  • 8
  • 41
  • 78

4 Answers4

17

There can be many reason for grayed out run button. Let's check one by one:

Configure the application.

Click the edit configuration in the combo box left to run button then select your app module: enter image description here

if the configuration is ok,then:

Check the AndroidMainfest.xml file and fix all error.

if this is also ok then

Just close the project File > Close Project and then reopen it,sometimes it works for me.

Fahim Al Mahmud Ashik
  • 1,083
  • 10
  • 26
  • 1
    Thanks... I added a new Configuration and named it App. The run button became available; however, when I click run another "edit configuration" box open. telling me "no module available"... when I click the module drop down menu, nothing is available to select. – miatech Jan 20 '17 at 17:57
  • I imported this project from github. I was working on a different computer (Linux) when I opened in Android Studio (windows) this happened. I wonder if there's an incompatibility on sdk versions? – miatech Jan 20 '17 at 17:58
  • ok, my AndroidManifest.xml file seems to have a few errors. http://pctechtips.org/pics/Capture.PNG – miatech Jan 20 '17 at 18:11
  • @miatech Where is your mainfest closing tag? Your mainfest should be closed like this ....all of your application and activity and everything goes here..... i think that is the error – Fahim Al Mahmud Ashik Jan 20 '17 at 21:15
  • @miatech that was the problem in your mainfest right? – Fahim Al Mahmud Ashik Jan 21 '17 at 19:59
3

I had my app folder in a parent folder and had opened the parent folder as if it was a project, so Android Studio was just acting like a file explorer with the build and debug buttons grayed out. I opened the actual project folder and everything was back to normal.

Eric
  • 31
  • 1
0

Please follow these steps:-

Go To Project Structure>Project>NOSDK

Change NOSDK to the latest ANDROID API PLATFORM

Then go to MODULE and DO THE SAME

Dharmbir Singh
  • 17,485
  • 5
  • 50
  • 66
0

Option to try

  1. Check module selected correctly In Edit Configuration, Check if any error there at bottom
  2. File -> Sync Project with gradle file
  3. File -> Invalidate cache and restart
  4. Still Not work then final option which work in my case is to remove .gradle , .idea folder then reopen project again (this folder re-generate again)
Sushant Gosavi
  • 3,647
  • 3
  • 35
  • 55