Android SDK命令行工具无法在Android Studio中干净安装

hs1ihplo  于 2023-03-16  发布在  Android
关注(0)|答案(1)|浏览(344)

我正在Windows 11 PC上学习一门新的React Native课程,突然惊讶地发现Android Studio SDK命令行工具似乎没有安装在Android Studio中:

我尝试安装它们,但收到以下消息:

Packages to install: - Android SDK Command-line Tools (latest) (cmdline-tools;latest)

Preparing "Install Android SDK Command-line Tools (latest) (revision: 9.0)".
Package "com.android.repository.impl.generated.v2.RemotePackage@f2c9fb88" (cmdline-tools;latest) should be installed in 
"C:\Users\userid\AppData\Local\Android\Sdk\cmdline-tools\latest" but 
it already exists.
Installing in "C:\Users\userid\AppData\Local\Android\Sdk\cmdline-tools\latest-5" instead.
Downloading https://dl.google.com/android/repository/commandlinetools-win-9477386_latest.zip
"Install Android SDK Command-line Tools (latest) (revision: 9.0)" ready.
Installing Android SDK Command-line Tools (latest) in C:\Users\userid\AppData\Local\Android\Sdk\cmdline-tools\latest-5
"Install Android SDK Command-line Tools (latest) (revision: 9.0)" complete.
"Install Android SDK Command-line Tools (latest) (revision: 9.0)" finished.

看来我是第五次安装它们了!安装后Android Studio似乎仍然没有看到它的安装。
您知道为什么Android Studio看不到已安装的Android SDK吗?我正在使用Android Studio测试React Native应用程序。我想知道这是否会阻止我调试React Native应用程序。通过C:\Users\userid\AppData\Local\Android\Sdk\cmdline-tools\latest-4删除C:\Users\userid\AppData\Local\Android\Sdk\cmdline-tools\latest是否安全?
我在命令提示符中看到以下内容:

C:\>DIR C:\Users\userid\AppData\Local\Android\Sdk\cmdline-tools
 Volume in drive C is Windows
 Volume Serial Number is C2D6-EBDB

 Directory of C:\Users\userid\AppData\Local\Android\Sdk\cmdline-tools

03/14/2023  06:05 AM    <DIR>          .
03/13/2023  07:03 AM    <DIR>          ..
02/27/2023  06:59 AM    <DIR>          bin
03/09/2023  04:34 AM    <DIR>          latest
03/09/2023  04:35 AM    <DIR>          latest-2
03/13/2023  10:20 AM    <DIR>          latest-3
03/14/2023  06:04 AM    <DIR>          latest-4
03/14/2023  06:05 AM    <DIR>          latest-5
02/27/2023  06:59 AM    <DIR>          lib
03/09/2023  04:30 AM           109,836 NOTICE.txt
03/09/2023  04:30 AM                84 source.properties
               2 File(s)        109,920 bytes
               9 Dir(s)  623,560,048,640 bytes free

C:\>echo %ANDROID_HOME%
C:\Users\userid\AppData\Local\Android\Sdk

C:\>
5ssjco0h

5ssjco0h1#

在Android Studio上,打开SDK管理器
导航至SDK工具选项卡
检查Android SDK命令行工具是否已启用。如果未启用,请检查并应用更改
由于某种原因,在更新Android Studio后,我也得到了这个错误。似乎一些新的要求没有自动安装由于某种原因。所以手动安装
这个帮我修好了。

相关问题