Centos7上未安装Android Build工具

时间:2017-09-21 04:43:52

标签: android linux centos android-build

我正在尝试在CentOS 7计算机上安装Android Build工具,作为移动项目持续集成的一部分。

我们有一个公司代理人和 1)我在/ etc / environment中设置了代理变量 2)我在gradle.properties中设置了代理信息(在〜/ .gradle / gradle.properties中(用于构建我的移动项目)

我按照这些说明安装了Android SDK

$concat_checkbox/text() = 'true'

最后一步是构建工具的更新卡住了一段时间后我得到了这个错误

 #Download and Install Android SDK. 
 mkdir -p /opt/sdk-tools-linux-3859397
 cd /opt/sdk-tools-linux-3859397
 sudo wget https://dl.google.com/android/repository/sdk-tools-linux-3859397.zip
 sudo unzip sdk-tools-linux-3859397.zip
 cd /opt
 sudo chown -R root:root sdk-tools-linux-3859397
 sudo ln -s sdk-tools-linux-3859397 android-sdk

 sudo vim /etc/profile.d/android-sdk-env.sh

 # Set Android SDK Environment Value.
 export ANDROID_HOME="/opt/android-sdk"
 export PATH="$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools:$PATH"

 sudo source /etc/profile.d/android-sdk-env.sh


 #Update Android SDK
 /opt/android-sdk/tools/bin/sdkmanager "tools" "build-tools;26.0.0" 

有关如何在构建服务器中获取构建工具的任何想法 我解决了问题和解决方案,但其中许多人建议使用Android Studio UI,我希望通过命令行安装。

我还按照Android SDK

尝试了以下命令
Info: Parsing /opt/sdk-tools-linux-3859397/tools/package.xml
Info: Parsing /opt/sdk-tools-linux-3859397/tools/package.xml
Info: IOException: https://dl.google.com/android/repository/addons_list-3.xml
Info: java.net.ConnectException: Connection timed out (Connection timed out)
Info: IOException: https://dl.google.com/android/repository/addons_list-2.xml
Info: java.net.ConnectException: Connection timed out (Connection timed out)
Info: IOException: https://dl.google.com/android/repository/addons_list-1.xml
Info: java.net.ConnectException: Connection timed out (Connection timed out)
Warning: Failed to download any source lists!

提前致谢。

1 个答案:

答案 0 :(得分:0)

最后我得到了解决方案 我认为这些“代理”服务器可以使生活复杂化。 我的一位同事建议使用cntlm代理,它工作正常 关注CNTLM Proxy Instructions
然后我执行了命令:

/opt/android-sdk/tools/bin/sdkmanager --no_https --proxy=http --proxy_host=127.0.0.1 --proxy_port=3128 "build-tools;26.0.1"

注意这次我用cntlm config替换了代理主机和代理端口。

工作正常 但是,即使在设置系统代理之后我仍然不确定为什么我们需要一个cntlm代理。它就像另一个代理的代理。

相关问题