4

enter image description hereI have installed new android studio and Imported my existing android project. whenever I run the app I get "Error running MyProjectName []: No task to execute is specified"

7:23 PM Executing tasks: [clean, :app:generateDebugSources, :app:generateDebugAndroidTestSources, :app:mockableAndroidJar]

7:24 PM Gradle build finished in 38s 639ms

7:26 PM Error running MyProjectName []: No task to execute is specified

I have tried to resolve the error with no luck can anyone help?

4

3 Answers 3

6

I tried the solution the error went away but no apk generate.

Solution I found

GO run -> run -> then choose app, not your project name as image show below.

enter image description here

1

Expand the app element on the right side. Find the installDebug task, and run that

2
  • What does this do?
    – Navigator
    Dec 23, 2017 at 18:39
  • It runs the project on a connected device Dec 23, 2017 at 18:51
0

I experienced the same problem after opening an old project and then opening my current one. I resolved that by opening completely another project in the same window, then opening again the problematic one.

I'm not sure what caused that problem but looks like it got refreshed when I opened another, working project in the same window.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.