I just updated Android Studio, and now when I try to build my app, I get the following Gradle error:
Information: Compilation completed with 2 e
This works for me to get rid of "Try Again" on the top about Gradle errors.
File >> Project Structure >> Project >> Android Gradle Plugin Version = 3.2.1 and Gradle Version 5.1.1 >> Ok >> Apply
Android Studio >> Build >> Make Project
You may get fine, but it will pop-up again for "Update Gradle" I choose "Do not remind me for this project"
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.
I had same issue, because my office PC is 32-bit and my home PC is 64 bit.
In the local.properties
file, I changed
sdk.dir=C:/Program Files/Android/android-studio/sdk
to
sdk.dir=C:/Program Files (x86)/Android/android-studio1/sdk
note the x86 version of Program Files
//according to my android studio project folder
just go into local file and open it into notepad then include the following line according to your project sdk file
sdk.dir=C\:/Users/raj/AppData/Local/Android/android-studio/sdk //
The most likely cause is the local.properties file is incorrect.
Check in the root folder and app folder for local.properties and make sure they point to the SDK folder. Both files must point to the SDK folder for this to work.
sdk.dir=C:\Users\me\AppData\Local\Android\Sdk
Took me forever to find it but this was fixed with buddahbrot's suggestion of creating a local.properties file in the root of your project folder to include sdk.dir= followed by the path to the sdk location.
This worked fine before with just ANDROID_HOME set in Windows but in OSX, I needed to specify with sdk.dir.