Kilian Koeltzsch Kilian Koeltzsch - 1 year ago 105
Android Question

IntelliJ IDEA unable to find android sdk

I'm trying to import a libGDX project into IntelliJ running OSX 10.9. When creating my own project it's not an issue specifying the path to the android sdk in the gdx-setup, but when importing one I keep getting the issue:

SDK location not found. Define location with sdk.dir in the file or with an ANDROID_HOME environment variable.


I haven't found anything resembling a file and wouldn't know how to create one, so I set the ANDROID_HOME environment variable with the path to my android sdk, adding this to my .bash_profile:
export ANDROID_HOME=/Applications/android-sdk

Additionally I added
to my PATH as well, which seems somewhat overkill, but unfortunately the PATH isn't recursive.

IntelliJ isn't getting any of this however, I'm guessing adding it to my .bash_profile isn't the right way of doing it?

Thank you very much in advance!


So thanks to the friendly people in the libGDX IRC it turned out to be relatively easy adding the file. The necessary content is just


This solves the problem and IntelliJ is now able to import the project. No further info on using environment variables.