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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-20 05:05:01  来源:igfitidea点击:

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

androidandroid-studio

提问by user3309991

Possible duplicate, I just download a Android Studio Zip file like Eclipse, as I opened getting this error.

可能重复,我只是下载了一个像 Eclipse 这样的 Android Studio Zip 文件,因为我打开了这个错误。

enter image description here

在此处输入图片说明

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- Runthe Android-Studio (a WELCOME screen will started).

2- RunAndroid-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 enter image description here

单击工具 > 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.+ 删除/移动任何内容。

  1. Open Android Studio and click cancel/ignore for error prompts on missing SDK for each project.
  2. Close all your open projects. You can do this by File > Close Project.
  3. After you do step 1 for all projects, the Welcome screen appears.
  4. 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.
  1. 打开Android Studio,点击cancel/ignore,出现每个项目缺少SDK的错误提示。
  2. 关闭所有打开的项目。您可以通过File > Close Project.
  3. 对所有项目执行步骤 1 后,将出现欢迎屏幕。
  4. 欢迎屏幕将检测您是否缺少 SDK 并为您提供解决问题的选项,即为您安装 SDK。

回答by Akash

  1. Create SDK folder at \Android\Sdk
  2. Close any project which is already open in Android studio
  1. 在 \Android\Sdk 创建 SDK 文件夹
  2. 关闭已在 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 下载:

  1. Close Android Studio
  2. Open android studio, but be ready
  3. Once you see "loading project", click cancel. (this will only appear for seconds on a fast machine)
  4. The SDK download window appeared!
  1. 关闭 Android Studio
  2. 打开android studio,但要做好准备
  3. 看到“正在加载项目”后,单击取消。(这只会在快速机器上出现几秒钟)
  4. 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 AppDatamay hidden if it will not show then enable show hidden content.

注意:AppData如果不显示,有时可能会隐藏,然后启用显示隐藏内容。

5.Apply Changes

5.应用更改

6.Then Select Sdk From Configureoption

6.然后选择Sdk FromConfigure选项

7.Then Android sdk manager page is open

7.然后Android sdk管理器页面打开

8.In bottom you will see Install packagesoption

8.在底部你会看到Install packages选项

9.Install them and enjoy.

9.安装它们并享受。