Android SDK 丢失、过时或缺少模板。请确保您使用的是 SDK 版本 22 或更高版本
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/21794272/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Android SDK is missing, out of date, or is missing templates. Please ensure you are using SDK version 22 or later
提问by user3309991
Possible duplicate, I just download a Android Studio Zip file like Eclipse, as I opened getting this error.
可能重复,我只是下载了一个像 Eclipse 这样的 Android Studio Zip 文件,因为我打开了这个错误。
But problem is how to update it?
但问题是如何更新它?
回答by Rajendra arora
same problem happened to me, From this
同样的问题发生在我身上,从这个
I have faced the same issue, to solve it:
我遇到了同样的问题,要解决它:
1- delete
(or move
) the projects folder (AndroidStudioProjects
).
1- delete
(或move
)项目文件夹(AndroidStudioProjects
)。
2- Run
the Android-Studio (a WELCOME screen will started).
2- Run
Android-Studio(将启动欢迎屏幕)。
3- From Welcome Screen choose, "Configure
-> Project Defaults
-> Project Structure
)
3- 从欢迎屏幕中选择,“ Configure
-> Project Defaults
-> Project Structure
)
4- Under Platform Settings choose SDKs
.
4- 在平台设置下选择SDKs
。
5- Select Android SDK
-> right_click delete
.
5- 选择Android SDK
-> right_click delete
。
6- Right_click
-> New Sdk
-> Android SDK
-> choose your SDK dir
-> then OK
.
6- Right_click
-> New Sdk
-> Android SDK
-> 选择你的SDK dir
-> 然后OK
。
7- Choose the Build target
-> apply
-> OK
. enjoy
7- 选择Build target
-> apply
-> OK
。请享用
回答by SolidSnake
I had same issue in Android Studio 3. (the project was open) so I closed the current project and the IDE automatically prompted to download the latest components. once its done everything was working correctly.
我在 Android Studio 3 中遇到了同样的问题。(项目已打开)所以我关闭了当前项目,IDE 会自动提示下载最新组件。一旦完成,一切正常。
回答by Bhaskara Arani
Click on Tools > SDK Manager or click SDK Manager
after If you are unable to see the location of your Android SDK Location, click on edit and create a folder where you want to keep it and then click Next and Finish
单击工具 > SDK 管理器或单击 SDK 管理器之后如果您无法看到您的 Android SDK 位置的位置,请单击编辑并创建一个您想要保留它的文件夹,然后单击下一步和完成
回答by codingjeremy
Here's a better approach where you don't have to delete/move anything for Android Studio 3.+.
这是一种更好的方法,您无需为 Android Studio 3.+ 删除/移动任何内容。
- Open Android Studio and click cancel/ignore for error prompts on missing SDK for each project.
- Close all your open projects. You can do this by
File > Close Project
. - After you do step 1 for all projects, the Welcome screen appears.
- The welcome screen will detect you are missing the SDK and give you options to fix the problem, i.e., install the SDKs for you.
- 打开Android Studio,点击cancel/ignore,出现每个项目缺少SDK的错误提示。
- 关闭所有打开的项目。您可以通过
File > Close Project
. - 对所有项目执行步骤 1 后,将出现欢迎屏幕。
- 欢迎屏幕将检测您是否缺少 SDK 并为您提供解决问题的选项,即为您安装 SDK。
回答by Akash
- Create SDK folder at \Android\Sdk
- Close any project which is already open in Android studio
- 在 \Android\Sdk 创建 SDK 文件夹
- 关闭已在 Android Studio 中打开的任何项目
Android Studio setup wizard will appear and perform the needed installation.
Android Studio 安装向导将出现并执行所需的安装。
回答by Eric Nelson
I was able to trigger an SDK download like this:
我能够像这样触发 SDK 下载:
- Close Android Studio
- Open android studio, but be ready
- Once you see "loading project", click cancel. (this will only appear for seconds on a fast machine)
- The SDK download window appeared!
- 关闭 Android Studio
- 打开android studio,但要做好准备
- 看到“正在加载项目”后,单击取消。(这只会在快速机器上出现几秒钟)
- SDK下载窗口出现了!
回答by Abeer Iqbal
If Android Studio directly opening your project instead of setup window, then just close the windows of all projects. Now you will able to see the startup window. If SDK is missing then it will provide option to download SDK and other required tools.
如果 Android Studio 直接打开你的项目而不是设置窗口,那么只需关闭所有项目的窗口。现在您将能够看到启动窗口。如果缺少 SDK,它将提供下载 SDK 和其他所需工具的选项。
It works for me.
这个对我有用。
回答by Vishal
1.Click on Configure
1.点击 Configure
2.Then Choose Project Defaults
2.然后选择 Project Defaults
3.Click on Project Structure
3.点击 Project Structure
4.Set android sdk path
4.设置安卓sdk path
You will find here "C:\User\YourPcname\AppData\Local\SDK"
你会在这里找到 "C:\User\YourPcname\AppData\Local\SDK"
Note:Sometime AppData
may hidden if it will not show then enable show hidden content.
注意:AppData
如果不显示,有时可能会隐藏,然后启用显示隐藏内容。
5.Apply Changes
5.应用更改
6.Then Select Sdk From Configure
option
6.然后选择Sdk FromConfigure
选项
7.Then Android sdk manager page is open
7.然后Android sdk管理器页面打开
8.In bottom you will see Install packages
option
8.在底部你会看到Install packages
选项
9.Install them and enjoy.
9.安装它们并享受。