Gradle build errors after updating Android Studio

Solution 1:

Try adding a new file in the root of your project called "local.properties" (or modify the existing one). It should contain

sdk.dir= 

followed by the path to the sdk location, in my case

sdk.dir=/Applications/Android Studio.app/sdk

I think Android Studio normally creates one automatically but says that it shouldn't be added to VCS. I put it in my .gitignore and cloned the project on my Mac which resulted in this error. Strangely before 0.1.5 it worked just fine without the file.

Solution 2:

i have had the Same issue with running Android-Studio on windows XP. After the Update it kept giving me the same error of Gradle: A problem occurred evaluating root project. so what i had to do is:

1- make sure you know where your android studio directory is in my case it was C:\Documents and Settings\UserName\Local Settings\Application Data\Android\android-studio\sdk

2- open the project root directory

3- locate the local.properties file and open it in a text editor notepad did it for me

4- change the sdk.dir="add your SDK directory here without the quotations" and make sure you use double instead of one on each separator sdk.dir=C:\\\Documents and Settings\\\UserName\\\Local Settings\\\Application Data\\\Android\\\android-studio\\\sdk

5- Rebuild your project

That was the only way it worked for me

Solution 3:

For me the problem was that in OS X, I need set my ANDROID_HOME to a full path, such as:

export ANDROID_HOME="/Users/username/Development/android-sdk-macosx"

When using the user directory shorthand (~) Gradle seems to consider it a relative directory.