Reputation: 751
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?
Upvotes: 62
Views: 99948
Reputation: 111
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)
Upvotes: 4
Reputation: 1856
As for me, I make next:
Upvotes: 6
Reputation: 195
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
Upvotes: 1
Reputation: 8490
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.
Upvotes: 2
Reputation: 1326
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.
Upvotes: 1
Reputation: 666
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.
Upvotes: 7
Reputation: 2663
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.
Upvotes: 20