安装 Android Studio:android-23 未安装

7

今天我在两台PC电脑上安装了Android Studio(版本1.5.1,构建141.2456560),但是我已经两次看到了这个错误。换句话说,在两台都运行Windows 10 Pro(x64,版本1511,构建10586.164)的电脑上都出现了同样的错误。

未安装以下SDK组件:android-23

error

什么问题?我该如何解决?

以管理员身份运行Android Studio。在我的情况下可行。 - Akhilesh Sinha
2个回答

6
这可能是由于Android Studio安装脚本出现问题引起的。也有可能是由于缺乏管理员权限引起的。
点击重试!当我遇到这个错误时,这个方法有用。
安装日志可能类似于这样。
Android SDK was installed to C:\Users\Bob\AppData\Local\Android\sdk


Installing Archives:
  Preparing to install archives
  Installing SDK Platform Android 6.0, API 23, revision 2
  Failed to rename directory C:\Users\Bob\AppData\Local\Android\sdk\platforms\android-23 to C:\Users\Bob\AppData\Local\Android\sdk\temp\RemotePlatformPkgInfo.old01.

SDK Manager: failed to install
-= Warning ! =-
A folder failed to be moved. On Windows this typically means that a program is using that folder (for example Windows Explorer or your anti-virus software.)
Please momentarily deactivate your anti-virus software or close any running programs that may be accessing the directory 'C:\Users\Bob\AppData\Local\Android\sdk\platforms\android-23'.
When ready, press YES to try again.
Note: you  can use --force to override to yes.
[y/n] =>
  Installing Android SDK Build-tools, revision 23.0.2
    Installed Android SDK Build-tools, revision 23.0.2
  Installing Local Maven repository for Support Libraries, revision 28
    Installed Local Maven repository for Support Libraries, revision 28
  Installing Google Repository, revision 24
    Installed Google Repository, revision 24
  Installing Android SDK Platform-tools, revision 23.1.0
    Stopping ADB server succeeded.
    Installed Android SDK Platform-tools, revision 23.1.0
  Installing Google APIs Intel x86 Atom System Image, Google Inc. API 23, revision 12
    Installed Google APIs Intel x86 Atom System Image, Google Inc. API 23, revision 12
    Stopping ADB server succeeded.
    Starting ADB server succeeded.
  Done. 5 packages installed.


Installing Archives:
  Preparing to install archives
  Installing SDK Platform Android 6.0, API 23, revision 2
    Installed SDK Platform Android 6.0, API 23, revision 2
  Done. 1 package installed.
Android SDK is up to date.
Creating Android virtual device
Android virtual device Nexus_5_API_23_x86 was successfully created

请注意,安装程序无法将以下目录从 from 重命名为:
C:\Users\Bob\AppData\Local\Android\sdk\platforms\android-23
到:
C:\Users\Bob\AppData\Local\Android\sdk\temp\RemotePlatformPkgInfo.old01
这可能是问题的原因。
在 Windows 上,这通常意味着某个程序正在使用该文件夹(例如 Windows Explorer 或您的防病毒软件)。
“程序”可能是 Android Studio 设置本身!如果是这样,那么 Android Studio 设置就做错了,但却指责其他程序这样做。
这也可能意味着 Android Studio 设置在尝试重命名或移动 AppData 中的文件夹时没有管理员权限。因此,右键单击 Android Studio 设置 EXE 文件并选择以管理员身份运行可能有助于避免此错误。
或者!它可能已经尝试超越自己并按错误的顺序进行操作,即在还坐在上面的树枝上剪掉树枝!
在我的情况下,单击再试一次就足够了。这可以通过日志看到。
Installing Archives:
  Preparing to install archives
  Installing SDK Platform Android 6.0, API 23, revision 2
    Installed SDK Platform Android 6.0, API 23, revision 2
  Done. 1 package installed.

完成设置后,无论是否存在错误,您都可以运行SDK管理器查看是否安装了“android-23”组件。启动Android Studio,从快速启动菜单中单击“配置”按钮,然后选择SDK Manager。然后导航到外观和行为、系统设置、Android SDK。勾选“Show Package Details”复选框,并确保所有API级别23的包都处于“已安装”的状态。您可以使用这种方式卸载、安装、重新安装和更新软件包。 android sdk manager

0
在我的情况下: 我只需再次执行.exe文件时以管理员身份运行。 然后按照以下步骤进行 -> 进入设置 ->附加设置 ->隐私:选中未知来源选项。 最后进入设置 ->附加设置 ->开发人员选项:选中通过USB安装选项。

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接