Gradle无法下载android软件包

我有一个Android SDK的Docker容器。 我正在尝试使用gradlew构buildAndroid Java应用程序。 事情是如果我需要从互联网下载我需要使用代理。 为此我configuration了我的android和gradle以使用代理设置。

我可以使用命令从命令行下载软件包

android更新sdk

但是当我运行gradlew它能够从jcentre下载依赖关系,但它试图下载一些Android包,我认为失败。 我已经粘贴下面的错误消息。

cat /root/.android/androidtool.cfg

sdkman.force.http=true http.proxyHost=gateway.bns http.proxyPort=8000 

猫gradle.properties

 systemProp.http.proxyHost=xyz.abc systemProp.http.proxyPort=8000 systemProp.http.nonProxyHosts=*.abc systemProp.https.proxyHost=xyz.abc systemProp.https.proxyPort=8080 systemProp.https.nonProxyHosts=*.abc 

./gradlew干净的testing汇编

 DK is missing a "platforms" directory. If you are using NDK, verify the ndk.dir is set to a valid NDK directory. It is currently set to /sdk/ndk-bundle. If you are not using NDK, unset the NDK variable from ANDROID_NDK_HOME or local.properties to remove this warning. Error: File /root/.android/repositories.cfg could not be loaded. java.net.ConnectException: Connection timed out (Connection timed out) IOException: https://dl.google.com/android/repository/addons_list-3.xml java.net.ConnectException: Connection timed out (Connection timed out) IOException: https://dl.google.com/android/repository/addons_list-2.xml java.net.ConnectException: Connection timed out (Connection timed out) IOException: https://dl.google.com/android/repository/addons_list-1.xml java.net.ConnectException: Connection timed out (Connection timed out) Failed to download any source lists! 

如果您使用的是比2.2.3 更新的插件版本,我认为这可能会链接到: 无法使用最新的Android Gradle插件更新sdk依赖关系