Reputation: 97
I want to set the default SDK for all projects because when I open a gradle project this error appears:
The SDK directory 'D:\androidproject\com.guvery.notifyme_15_src\com.guvery.notifyme_15_src.tar.gz\home\vagrant\android-sdk' does not exist. Please fix the 'sdk.dir' property in the local.properties file.
How can I fix it?
Upvotes: 1
Views: 5730
Reputation: 7537
According to the documentation:
https://docs.gradle.org/current/userguide/build_environment.html
Add this to gradle.properties
org.gradle.java.home=/path/to/your/java/home
It doesn't seem to work though for Android at least. Setting local.properties with the proper path should work, another option can be to set JAVA_HOME to that path and for Android the ANDROID_HOME variable like e.g. :
export ANDROID_HOME=$HOME/Library/Android/sdk
#export PATH=$PATH:$ANDROID_HOME/emulator
#export PATH=$PATH:$ANDROID_HOME/platform-tools
Upvotes: 0
Reputation: 364730
In a single project, open the local.properties
file and set the
sdk.dir=/home/myFolder/androidSdk
To change the sdk dir for all project, in Android Studio.
File -> Other Setting -> Default project structure
Upvotes: 2