Android Studio - SDK is out of date or is missing templates

AndroidJavaAndroid Studio

Android Problem Overview


I downloaded Android Studio, fixed the JDK Environmental Variable, but when I try to create a New Project, I get an error that says

> Your Android SDK is out of date or is missing templates. Please ensure you are using SDK version 22 or later.

I opened up android.bat in the SDK but it said I was already running version 22.

Anyone else getting this?

Android Solutions


Solution 1 - Android

It just happened because you already have your SDK setted up for Android Developers Bundle with eclipse. Simply open your SDK manager in the ADT Bundle and update you Android SDK Tools from 21.1 to 22 and you are good to go.

Worked for me.

Solution 2 - Android

First of all, on Windows and Mac, the individual tools and other SDK packages are saved with the Android Studio application directory.

Windows: \Users\<user>\AppData\Local\Android\android-studio\sdk\
Mac: /Applications/Android\ Studio.app/sdk/

Make sure your android-sdk-path is correct and the sdk tool version is 22 or later.

Then open the Configure--> Project Defaults --> Project Structure, set your project sdk is Android SDK.

enjoy.

Solution 3 - Android

As for me, I make next:

  1. Start Eclipse -> start SDK -> install selected packages
  2. Eclipse -> Help -> check for updates -> update all
  3. Android Studio -> configure -> Project Defaults -> Project structure -> Press plus -> Android SDK -> put path to the same sdk that you use in eclipse (run SDK and in top panel you can see this path).
  4. Apply

Solution 4 - Android

I did all of the above and still got the ....missing templates blah blah. What worked for me was to go to Configure>Project Defaults>Project Structure>Project and select Android SDK, then Configure>Project Defaults>Project Structure>SDKs map the Android SDK home path to the sdk folder in the ADT bundle (for me it was C:\Users\home\Toolbox\adt-bundle-windows-x86\sdk).
I then selected Android 4.1.2 clicked apply and it worked.
I then went back to the Configure>Project Defaults>Project Structure>SDKs and then selected Android 4.2.2 and now that worked too (strange though as when I selected Android 4.2.2 first time the Apply button was grayed out)

Solution 5 - Android

I ran into this problem because I wanted to update from an old version. In doing this, I downloaded the latest version from the Project Tools Site, then unzipped and copied over my existing Android Studio install which did have the sdk folder inside.

Going back and looking at it, I see quite plainly that there was a note that I previously ignored:

> NOTE: These .zip files do not contain an embedded SDK install. If you have an existing install of Studio which contains an embedded SDK, if you upgrade by installing one of these zips, make sure you copy over the SDK as well.

For OS X users, this means going to your old version of Android Studio (if you haven't copied over it yet) and right-clicking and selecting Show Package Contents, then copying the sdk folder that's inside, then putting that into the new version of Android Studio.

If, like me, you already copied over the old version, then you'll need to redownload the old version first which does contain the SDK.

Solution 6 - Android

They released a new sdk today. You need to update to it.

Solution 7 - Android

I was still hitting this, and figured it was due to something I had misconfigured (which turned out to be the case). The error message is a little confusing, too, because I believe that they are referring to is the version of the ADT tools, not the SDK. For example, the version of Android 4.3 (which is about the latest) is 18.

As of the latest source for Android Studio (which you can clone from here: https://android.googlesource.com/platform/tools/adt/idea), that message is generated from NewProjectWizard.java at about line 75 if TemplateManager.templatesAreValid() is false. And it checks that by looking for the existence of the file [rootTemplatesFolder]/gradle/wrapper/gradlew .

It gets the [rootTemplatesFolder] from the SDK(s) you specified in the "Project Structure" settings for default projects. In my case, I had several specified - both the new ones pointing to the sdk directory that's (thankfully) part of the Android Studio, and a few old ones I had somewhere else. I should not have included the old ones at all, but I'm a newb to this and the GUI let me do it. The NewProjectWizard was checking the tools area of that one first, which did not have that file, since the tools version with it was older than version 22.

I had to use dtruss to watch the system calls of Android Studio to see where it was looking for that file, at which point I could tell what my silly problem was.

I have a few more notes on this, including a screenshot of my particular misconfiguration, at http://www.nowherenearithaca.com/2013/08/solved-android-studio-and-your-android.html

Note: It seems you have to restart Android Studio for the "New Project Settings" here to take effect.

Solution 8 - Android

for ubuntu: Open sdk manager from Android Studio or configuration. make sure you download or update the latest release SDK and build tools. >> Set the sdk location as (your android folder/sdk) It'll download and install sdk

Solution 9 - Android

just Update sdk with sdk manager it worked for me

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionScott CarlsonView Question on Stackoverflow
Solution 1 - AndroidUsman TahirView Answer on Stackoverflow
Solution 2 - AndroidtwocityView Answer on Stackoverflow
Solution 3 - AndroidKostya KhutaView Answer on Stackoverflow
Solution 4 - AndroidMauve GuavaView Answer on Stackoverflow
Solution 5 - AndroidKyle FalconerView Answer on Stackoverflow
Solution 6 - AndroidLarry McKenzieView Answer on Stackoverflow
Solution 7 - Androiduser655489View Answer on Stackoverflow
Solution 8 - Androidjoy oaresView Answer on Stackoverflow
Solution 9 - Androidrobin.liuView Answer on Stackoverflow