Gradle can not find android sdk

I compile gradle example in android annotation , it can not find android sdk. I have configed ANDROID_SDK_HOME .

The inline 17 in build.gradle is: apply plugin: ‘androidannotations’

The android annotation project:

The gradle-androidannotations-plugin:

jelly@jelly-VirtualBox:~/code/androidannotation/androidannotations/examples/gradle$ gradle tasks Creating properties on demand (a.k.a. dynamic properties) has been deprecated and is scheduled to be removed in Gradle 2.0. Please read for information on the replacement for dynamic properties. Deprecated dynamic property: “abbreviation” on “root project ‘gradle’”, value: “GRADLESAMPLE”.

FAILURE: Build failed with an exception.

  • Where: Build file ‘/home/jelly/code/androidannotation/androidannotations/examples/gradle/build.gradle’ line: 17

  • What went wrong: A problem occurred evaluating root project ‘gradle’. > Unable to find location of Android SDK. Please read documentation.

  • Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.


Total time: 5.877 secs

There are several ways to point Gradle to your local SDK directory. 1. Set the ANDROID_HOME environment variable and restart a console/IDE. 2. Set the sdk.dir property in ‘’ file.