I'm in the process of running through a tutorial on getting Libgdx working with eclipse on my MAC.
I am currently building one of the example projects using gradle in eclipse so I can run through the tutorials and learn a bit more. When I import and build the example code project (I'm using a MAC) I get the below error message:
"SDK location not found. Define a location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable".
In an attempt to resolve this problem I have attempted and checked the following:
1) Installed the latest version of the JDK and setup JAVA_HOME - confirmed existence by echoing the variable from a terminal.
2) Installed the latest and various other versions of the android SDK and plugins and setup ANDROID_HOME. - Confirmed by checking the Android Studio SDK location and echoing $ANDROID_HOME
3) I also found this thread and the suggested solution was to update local.properties with sdk.dir which I have also tried and I still get the same error:
Gradle, Android and the ANDROID_HOME SDK location
4) I have setup the eclipse android preferences to make sure it is looking at ANDROID_HOME and it can see the various SDK folders.
I have also made a few attempts to add the --stacktrace options via android studio however that hasn't seemed to produce output in eclipse.
I'm going to try building the project via the commandline outside eclipse now and see if that works.. Has anyone come across this issue before?
Phill
Close the current project and you'll see a pop-up with a dialog which will then proceed to Configure option. Configure -> Project Defaults -> Project Structure -> SDKs on left column -> Android SDK Home Path -> give the exact path as you did on local. properties and select Valid Target.
Generally, the Android SDK is installed in the /Users/user-name/Library/Android/sdk folder on macOS.
Open eclipse, click window tab it will show a drop down menu, click preferences, in preferences window click Android, here u go Sdk location is right in front of u copy the address :) Show activity on this post.
I finally fixed this after 10 hours of racking my brains and trying every solution under the sun.
The solution was to set the sdk.dir in the local.properties file as the error suggested. Where I was going wrong was the location of the local.properties file.
This must be in the projects root folder (i.e where settings.gradle, gradlew and gradlew.bat are) as the below thread suggests!
Where does local.properties go for android project?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With