Search code examples
androidlibgdxandroid-sdk-tools

libGDX can not see Android SDK


I am a newbie android develiper. I have just installed the most recent Android Studio and downloaded libGDX setup tool. However, when I try to generate a new project, it shows the error:

Your Android SDK path doesn't contain an SDK! Please install the Android SDK, including all platforms and build tools!

I am pretty sure I have Android SDK installed and I put a correct location C:\Users\Denis\AppData\Local\Android\Sdk, because I copied it from Android studio.

enter image description here


Solution

  • This is how libGDX is checking if android SDK location valid:

    public static boolean isSdkLocationValid (String sdkLocation) {
        return new File(sdkLocation, "tools").exists() && new File(sdkLocation, "platforms").exists();
    }
    

    However, I don't have tools folder in my setup. Probably, in fresh Android SDK it was renamed or I don't have required tools installed, not sure (pls suggest in comments). However, the workaround is to create an empty tools folder in C:\Users\Denis\AppData\Local\Android\Sdk