Reputation: 2163
When I try to compile my application, I get the following error:
Gradle:
FAILURE: Could not determine which tasks to execute.
* What went wrong:
Task 'assembleDebug' not found in root project 'Project'.
* Try:
Run gradle tasks to get a list of available tasks.
Could not execute build using Gradle installation 'C:\Users\[username]\.gradle\wrapper\dists\gradle-1.6-bin\72srdo3a5eb3bic159kar72vok\gradle-1.6'.
Now I have been searching around on stackoverflow and other websites, and I am not the only person experiencing this issue. I tried this solution, aswell as restarting the program several times, and reinstalling Android Studio entirely. Still I'm getting the same error. I also tried manually deleting the "gradle-1.6" folder from the
'C:\Users\[username]\.gradle\wrapper\dists\gradle-1.6-bin\72srdo3a5eb3bic159kar72vok\'
folder, and putting the newest version of gradle into the folder manually.
Nothing helped. Still getting the error.
Upvotes: 2
Views: 10320
Reputation: 1705
Re-adding my JDK location fixes this error for me. I open File->Project Structure and re-enter the JDK location by deleting the last directory in the path (Home) and then re-typing it. The path looks exactly the same as before, but the error goes away and I can build from Android Studio again.
Definitely a bug in Android Studio, it seems like the path is getting corrupted at some level.
Upvotes: 0
Reputation: 1750
In my case, once, the JDK's location was not defined correctly. The error did not tell this, but fixing the JDK's location corrected the error.
Upvotes: 1
Reputation: 14698
Doublecheck your gradle-installation to see if its properly set up.
gradle build
Upvotes: 1