Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android SDK Command line tools doesn't install cleanly in Android Studio

I was following along with a new React Native course on my Windows 11 PC when I was surprised when I noticed that it didn't appear that the Android Studio SDK Command line tools didn't appear to be installed in Android Studio:

Android SDK Settings

I tried installing them and I get the following message:

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.

So it appears that I'm installing them for the 5th time! After the installation Android Studio still doesn't seem to see that it's installed.

Any idea why Android Studio doesn't see the Android SDK is intalled? I'm using Android Studio to test React Native applications. I'm wondering if this will prevent me from being able to debug React Native Applications. Is it safe for me to delete C:\Users\userid\AppData\Local\Android\Sdk\cmdline-tools\latest through C:\Users\userid\AppData\Local\Android\Sdk\cmdline-tools\latest-4?

I see the following in a command prompt:

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:\>
like image 597
Eric Avatar asked Sep 01 '25 10:09

Eric


2 Answers

I encountered the same problem, reinstalling it repeatedly will generate a new "latest" file, but Android Studio won't recognize it until I delete the cmdline-tools folder and then reinstall it. This resolves my issue.

like image 191
Islaturrahman Avatar answered Sep 04 '25 02:09

Islaturrahman


On Android Studio, open the SDK Manager.

Navigate to the SDK Tools tab.

Check to see if Android SDK Command-line Tools are enabled. If not, check it and apply the changes.

For some reason, after updating Android Studio, I got this error too. It appears that some new requirement was not automatically installed for some reason. So install it manually.

This fixed it for me.

like image 34
Tester Developer Avatar answered Sep 04 '25 00:09

Tester Developer