Anthea
Anthea

Reputation: 3809

Intellij android project setup - run button is disabled

I have an android project with dependencies on actionbar sherlock. It compiles without error but the run Button is disabled. I have another android project that works fine and runs on my device, but I cannot see the difference between those projects - except I am able to run the one project and I am not able to run the other.

I would provide screenshots, but actually I don't have any idea where this problem is located.

Any idea?

Upvotes: 16

Views: 35997

Answers (3)

Tonnie
Tonnie

Reputation: 8112

  1. Right-click the class file with the main method on the project view.
  2. Select Run.

Run configuration is created automatically so that you don't have to set it.

Upvotes: 1

Warren  P
Warren P

Reputation: 68902

In 2017, IntelliJ idea wants to index stuff for several minutes before it will enable the Run option.

This appears to be by design.

Upvotes: 5

Kevin Coppock
Kevin Coppock

Reputation: 134664

Did you set up a Run/Debug Configuration?

You should see a drop down to the left of the Run button; click it and click "Edit Configurations". In the top-left, click the "+" to add a new configuration, and select "Android Application". Select the Module (usually it's just your main project) to launch, choose the Target Device (hardware or emulator), give it a name, and then click OK.

Now you should be able to run with that configuration.

Upvotes: 46

Related Questions