SDK location not found. ANDROID_HOME - create gradle project in eclipse on MAC

I am in the process of running a tutorial on how Libgdx works with eclipse on my MAC.

I am currently creating one example project using gradle in eclipse so that I can go through tutorials and learn a little more. When I import and create a sample code project (I use MAC), I get the following error message:

"SDK location not found. Locate using sdk.dir in local.properties file or with ANDROID_HOME environment variable."

In an attempt to solve this problem, I tried and checked the following:

1) Installed the latest version of JDK and installed JAVA_HOME - confirmed the existence by repeating the variable from the terminal.

2) The latest and other versions of the SDK and plugins for Android and the ANDROID_HOME settings have been installed. - Confirmed by checking Android Studio SDK location and repeating $ ANDROID_HOME

3) I also found this thread, and the proposed solution was to update local.properties with sdk.dir, which I also tried and I still get the same error:

Gradle, Android and location SDK ANDROID_HOME

4) I set the eclipse android settings to make sure it looks at ANDROID_HOME and it can see various SDK folders.

I also made several attempts to add -stacktrace options through Android studio, but didn't seem to give the result in eclipse.

Now I'm going to create a project through the command line outside of the eclipse and see if this works. Has anyone encountered this problem before?

Phill

+8
android eclipse build.gradle gradle libgdx
source share
2 answers

I finally fixed it after 10 hours, breaking my brains and trying to solve every decision under the sun.

The solution was to set the sdk.dir file in the local.properties file as a suggested error. Where I was wrong was the location of the local.properties file.

This should be in the root folder of the projects (i.e. where settings.gradle, gradlew and gradlew.bat are), as the following thread suggests!

Where does local.properties execute for an Android project?

+15
source share

I had the same error and could not find the answer to fix my problem. It was actually pretty simple. Some answers say placing the local.properties file in the root of the project. The project root is not in /../projectlocation , but in /../projectlocation/android if you are creating for android. After moving my local.properties from /projectlocation to /projectlocation/android it works.

+1
source share

All Articles