androidcordovaandroid-sdk-toolsplatform-tools

sdkmanager Warning: Failed to download any source lists


Ive been working on this problem for like hours and tried everything, but I cant get past this roadblock.

I intend to create an APK using Apache Cordova, while trying to execute sdkmanager --list

I get this output:

C:\Windows\system32>sdkmanager --list
Warning: Failed to download any source lists!
Warning: IO exception while downloading manifest
Warning: IO exception while downloading manifest
Warning: Still waiting for package manifests to be fetched remotely.
[=======================================] 100% Computing updates...

and for getting build tools:

C:\Windows\system32>sdkmanager "build-tools;29.0.0"
Warning: Failed to download any source lists!
Warning: IO exception while downloading manifest
Warning: IO exception while downloading manifest
Warning: Still waiting for package manifests to be fetched remotely.
Warning: Failed to find package 'build-tools;29.0.0'
[===                                    ] 10% Computing updates...
C:\Windows\system32>

Things I've tried:

  1. Disable firewall and/or antivirus
  2. Running cmd and PowerShell as administrator
  3. Restarting my system and deleting caches
  4. Ran some proxy server command too but it didn't work
  5. Removing .android file from appdata (wasn't there anyway)
C:\Windows\system32>sdkmanager --version
5.0

Environment Variables are working fine, and no Android Studio was previously installed.

Thanks in advance


Solution

  • Solved it. There were 2 problems:

    1. Reinstalling Java from java.com/en/download Give correct path of JAVA_HOME and JAVA_EXE
    2. setting the correct directories of the sdkmanager.bat

    The default one is messed up... Keep it exactly like this: C:\Android\sdk\cmdline-tools\5

    folder name 5 is the version name. Not necessarily need to be correct if you want to find the version, open the NOTICE.txt you get from commandline-tools

    It ran fine without any admin rights or firewall disabling