问题
I am trying to install android command line tools using sdkmanager on windows for hybrid android app development in SAP web IDE. Also I am under a proxy network and when I try to set proxy using cmd by the command :
sdkmanager --list --verbose --no_https --proxy=http --proxy_host=10.60.11.11 --proxy_port=8080
It displays the error :
Info: Parsing C:\Users\10002001\Downloads\sdk-tools-windows-
3859397\tools\package.xml
Info: Parsing C:\Users\10002001\Downloads\sdk-tools-windows-
3859397\tools\package.xml
Info: Failed to validate the XML for the repository at URL
'http://dl.google.com
/android/repository/repository2-1.xml/repository-12.xml'
Warning: Errors during XML parse:
Warning: javax.xml.bind.UnmarshalException
- with linked exception:
[java.net.ConnectException: Connection refused: connect]
Warning: Additionally, the fallback loader failed to parse the XML.
Warning: Failed to parse source list at
https://dl.google.com/android/repository/addons_list-3.xml
Warning: File C:\Users\10002001\.android\repositories.cfg could not be
loaded.
Installed packages:
--------------------------------------
tools
Description: Android SDK Tools 26.0.1
Version: 26.0.1
Installed Location: C:\Users\10002001\Downloads\sdk-tools-windows-3859397\to
ols
done
And when I give this command to install platform tools :
sdkmanager platform-tools
It gives this result:
Warning: java.net.ConnectException: Connection refused: connect
Warning: File C:\Users\10002001\.android\repositories.cfg could not be
loaded.
Warning: Failed to download any source lists!
Warning: Failed to find package platform-tools
Please help!!
回答1:
With sdkmanager you should always use proxy switches. I did not yet found a way to make it a system or user setting.
sdkmanager platform-tools --no_https --proxy=http --proxy_host=10.60.11.11 --proxy_port=8080
For file warning simply create an empty file at C:\Users\10002001\.android\repositories.cfg
For connection exception make sure the user has internet access and try opening the link https://dl.google.com/android/repository/addons_list-3.xml
in a browser or wget/curl.
来源:https://stackoverflow.com/questions/46293077/installing-android-command-line-tools-using-sdkmanager-on-windows