【发布时间】:2017-07-05 14:55:40
【问题描述】:
我有一个带有 Android SDK 的 docker 容器。我正在尝试使用 gradlew 构建一个 Android Java 应用程序。问题是如果我需要从互联网下载,我需要使用代理。为此,我已将我的 android 和 gradle 配置为使用代理设置。
我可以使用命令从命令行下载软件包
安卓更新sdk
但是当我运行 gradlew 时,它能够从 jcentre 下载依赖项,但尝试下载一些我认为的 Android 包失败。我在下面粘贴了错误消息。
cat /root/.android/androidtool.cfg
sdkman.force.http=true
http.proxyHost=gateway.bns
http.proxyPort=8000
cat 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 clean test assemble
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!
【问题讨论】:
标签: android docker gradle proxy android-gradle-plugin