Reputation: 3121
I 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?
Upvotes: 4
Views: 4529
Reputation: 592
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.
Upvotes: 0
Reputation: 3121
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.
Upvotes: 6
Reputation: 191874
Expand the app
element on the right side. Find the installDebug
task, and run that
Upvotes: 1