6

I have updated to the latest Android SDK and set JAVA_HOME in .bash_profile using export JAVA_HOME=$(/usr/libexec/java_home), and I'm getting the following error:

Error Gradle: 
FAILURE: Could not determine which tasks to execute.
* What went wrong:
Task 'assembleDebug' not found in project ':CrystalBall'.
* Try:
Run gradle tasks to get a list of available tasks.

Error: Could not execute build using Gradle distribution    
    http://services.gradle.org/distributions/gradle-1.6-bin.zip

I've attached a screenshot:

Error Screenshot

What should I do?

Jason Sundram
  • 12,225
  • 19
  • 71
  • 86
thetrystero
  • 5,622
  • 5
  • 23
  • 34
  • This is strange. What happens if you create a brand new project using Android Studio? Do you get the same error? Also, what happens if you use the command line? – Ikai Lan Jun 11 '13 at 18:55
  • hi, it is a brand new project, not imported from eclipse. how do i run it from the command line? – thetrystero Jun 15 '13 at 05:14
  • Duplicate? http://stackoverflow.com/questions/16580776/android-studio-new-project-can-not-run-throwing-error – naught101 Jan 08 '15 at 14:00

2 Answers2

1

The second error in your screenshot seems more important to me. You have to make sure, that the Android Studio is able to download and execute the gradle binary. If you are using a proxy you have to configure it in the Android Studio.

To check the gradle tasks, go to your project folder on the command line and type "gradlew tasks"

You can also configure a proxy for gradle. Just create a gradle.properties file in (your project folder) with these properties:

systemProp.http.proxyHost=www.example.org
systemProp.http.proxyPort=8080
systemProp.http.proxyUser=userid
systemProp.http.proxyPassword=password
systemProp.http.nonProxyHosts=*.nonproxy.com|localhost
rivare
  • 817
  • 8
  • 6
1

I don't believe this is the issue the poster had, but for the benefit of others I'll add what I found as I was helping someone on Windows XP who was getting the same error.

It appears the issue in his case was that the path to the Android Studio project had spaces in it (since Windows XP uses the Documents and Settings directory). I had him generate a new project into a directory without spaces in it and it built and ran without problems. Might have actually been something else, but as usual it is best to avoid spaces in paths.